Skip to content

Commit ea099d1

Browse files
committed
Updated baudrate consistently in changeBaudrate. Cleaned up a few debugging lines.
1 parent 53a9d15 commit ea099d1

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

port.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function updatePort(port, alist) {
112112
// Empty port path? If wireless port, craft path from mac, else abort (reject)
113113
if (port.isWireless && port.mac) {alist.path = makePortName(port.mac)} else {reject(Error("path required!")); return}
114114
}
115-
//!!! log("Updating port '" + port.path + "' with " + alist, mDbug);
115+
// log("Updating port '" + port.path + "' with " + alist, mDbug);
116116
// Apply updates (if necessary) as well as special handling
117117
set("path");
118118
set("connId");

serial.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function changeBaudrate(port, baudrate) {
145145
if (port.isWired) {
146146
chrome.serial.update(port.connId, {'bitrate': baudrate}, function (updateResult) {
147147
if (updateResult) {
148-
port.baud = baudrate;
148+
updatePort(port, {baud: baudrate});
149149
resolve();
150150
} else {
151151
reject(Error(notice(neCanNotSetBaudrate, [port.path, baudrate])));
@@ -158,12 +158,12 @@ function changeBaudrate(port, baudrate) {
158158
//Update port record with socket to Propeller's HTTP service
159159
updatePort(port, {phSocket: info.socketId});
160160
if (!port.phSocket) {
161-
log("NULL SOCKET!!!", mDbug); //!!!
161+
log("NULL SOCKET!!!", mDbug); //!!!!
162162
}
163163
let postStr = "POST /wx/setting?name=baud-rate&value=" + baudrate + " HTTP/1.1\r\n\r\n";
164164
chrome.sockets.tcp.connect(port.phSocket, port.ip, 80, function() {
165165
chrome.sockets.tcp.send(port.phSocket, str2ab(postStr), function () {
166-
//!!! port.baud = baudrate;
166+
updatePort(port, {baud: baudrate});
167167
propComm.response
168168
.then(function() {return resolve();})
169169
.catch(function(e) {return reject(e);})

wx.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ WXVer = ["v1.0"];
2424
// Container for the active UDP socket used for discovery broadcasts
2525
var udp_sock;
2626

27-
//!!! var tcp_sock;
28-
2927
// Initial discovery packet. 4-bytes per module representing the module's IP are appended as Wi-Fi modules are found
3028
// signaling to a module that it does not have to re-respond.
3129
var disc_packet = '\0\0\0\0';
@@ -221,7 +219,7 @@ function isValidWiFiVersion(response) {
221219
// chrome.sockets.tcp.send(tcp_sock, str2ab(getStr), function() {});
222220
223221
//Generate loader package (in txData)
224-
let packetId = 1; //!!!
222+
let packetId = 1;
225223
generateLoaderPacket(ltUnEncCore, packetId, defaultClockSpeed, defaultClockMode);
226224
chrome.sockets.tcp.send(tcp_sock, txData, function() {});
227225

0 commit comments

Comments
 (0)