Skip to content

Commit 8327741

Browse files
committed
Extended changeBaudrate response timeout by 3x. Extended mblDeliveryTime by 3x. Both of these because errors happened on occasion presumably due to network congestion.
1 parent 6ca004c commit 8327741

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ function talkToProp(sock, port, binImage, toEEPROM) {
411411
/* Calculate expected Micro Boot Loader and User Application delivery times
412412
= 300 [>max post-reset-delay] + ((10 [bits per byte] * (data bytes [transmitting] + 20 silence bytes [MBL waiting] + 8 MBL "ready" bytes [MBL responding])) /
413413
initial baud rate) * 1,000 [to scale ms to integer] + 1 [to always round up] + 500 [Rx hardware to OS slack time] */
414-
var mblDeliveryTime = 300+((10*(txData.byteLength+20+8))/initialBaudrate)*1000+1+500;
414+
var mblDeliveryTime = 300+((10*(txData.byteLength+20+8))/initialBaudrate)*1000+1 + (port.isWireless) ? 1500 : 250;
415415

416416
//=((10 [bits per byte] * [max packet size]) / final baud rate) * 1,000 [to scale ms to integer] + 1 [to always round up] + 1500 or 250 [Network or Rx hardware to OS slack time]
417417
var userDeliveryTime = ((10*maxDataSize)/finalBaudrate)*1000+1 + (port.isWireless) ? 1500 : 250;

serial.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ function changeBaudrate(port, baudrate) {
153153
});
154154
} else {
155155
//TODO Need to check for errors.
156-
resetPropComm(port, 500, sgWXResponse, notice(neCanNotSetBaudrate, [port.path, baudrate]), true);
156+
resetPropComm(port, 1500, sgWXResponse, notice(neCanNotSetBaudrate, [port.path, baudrate]), true);
157157
chrome.sockets.tcp.create(function (info) {
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() {

0 commit comments

Comments
 (0)