Skip to content

Commit 366a8d5

Browse files
committed
Merge branch 'platform'
2 parents 6b04b07 + 1fd859a commit 366a8d5

File tree

13 files changed

+70
-40
lines changed

13 files changed

+70
-40
lines changed

dist/webduino-all.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,6 @@ if (typeof exports !== 'undefined') {
40364036
STRING_MESSAGE: 'stringMessage',
40374037
SYSEX_MESSAGE: 'sysexMessage',
40384038
PIN_STATE_RESPONSE: 'pinStateResponse',
4039-
BEFOREREADY: 'beforeReady',
40404039
READY: 'ready',
40414040
ERROR: 'error',
40424041
BEFOREDISCONNECT: 'beforeDisconnect',
@@ -4271,7 +4270,7 @@ if (typeof exports !== 'undefined') {
42714270
switch (command) {
42724271
case DIGITAL_MESSAGE:
42734272
this._logger.info('processMultiByteCommand digital:', channel, commandData[1], commandData[2]);
4274-
this.processDigitalMessage(channel, commandData[1], commandData[2]);
4273+
this._options.handleDigitalPins && this.processDigitalMessage(channel, commandData[1], commandData[2]);
42754274
break;
42764275
case REPORT_VERSION:
42774276
this._firmwareVersion = commandData[1] + commandData[2] / 10;
@@ -4363,7 +4362,6 @@ if (typeof exports !== 'undefined') {
43634362
break;
43644363
case ANALOG_MAPPING_RESPONSE:
43654364
this.processAnalogMappingResponse(sysexData);
4366-
this.emit(BoardEvent.BEFOREREADY);
43674365
break;
43684366
default:
43694367
this.emit(BoardEvent.SYSEX_MESSAGE, {
@@ -4468,7 +4466,14 @@ if (typeof exports !== 'undefined') {
44684466
}
44694467

44704468
if (!this._isReady) {
4471-
this.enableDigitalPins();
4469+
if (this._options.initialReset) {
4470+
this.systemReset();
4471+
}
4472+
if (this._options.handleDigitalPins) {
4473+
this.enableDigitalPins();
4474+
} else {
4475+
this.startup();
4476+
}
44724477
}
44734478
};
44744479

@@ -4942,7 +4947,9 @@ if (typeof exports !== 'undefined') {
49424947
login: 'admin',
49434948
password: 'password',
49444949
autoReconnect: false,
4945-
multi: false
4950+
multi: false,
4951+
initialReset: false,
4952+
handleDigitalPins: true
49464953
};
49474954
}
49484955

@@ -5579,7 +5586,9 @@ chrome.bluetoothSocket = chrome.bluetoothSocket || (function (_api) {
55795586
login: 'admin',
55805587
password: 'password',
55815588
autoReconnect: false,
5582-
multi: false
5589+
multi: false,
5590+
initialReset: false,
5591+
handleDigitalPins: true
55835592
};
55845593
}
55855594

@@ -5600,6 +5609,7 @@ chrome.bluetoothSocket = chrome.bluetoothSocket || (function (_api) {
56005609
});
56015610

56025611
Smart.DEFAULT_SERVER = 'wss://ws.webduino.io:443';
5612+
Smart.SERVER_CHINA = 'wss://ws.webduino.com.cn';
56035613

56045614
scope.board.Smart = Smart;
56055615
}));
@@ -5637,7 +5647,9 @@ chrome.bluetoothSocket = chrome.bluetoothSocket || (function (_api) {
56375647
login: 'admin',
56385648
password: 'password',
56395649
autoReconnect: false,
5640-
multi: false
5650+
multi: false,
5651+
initialReset: false,
5652+
handleDigitalPins: true
56415653
};
56425654
}
56435655

@@ -5658,6 +5670,7 @@ chrome.bluetoothSocket = chrome.bluetoothSocket || (function (_api) {
56585670
});
56595671

56605672
Bit.DEFAULT_SERVER = 'wss://ws.webduino.io:443';
5673+
Bit.SERVER_CHINA = 'wss://ws.webduino.com.cn';
56615674

56625675
proto.startup = function () {
56635676
this._isReady = true;

dist/webduino-all.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webduino-base.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,6 @@ if (typeof exports !== 'undefined') {
40364036
STRING_MESSAGE: 'stringMessage',
40374037
SYSEX_MESSAGE: 'sysexMessage',
40384038
PIN_STATE_RESPONSE: 'pinStateResponse',
4039-
BEFOREREADY: 'beforeReady',
40404039
READY: 'ready',
40414040
ERROR: 'error',
40424041
BEFOREDISCONNECT: 'beforeDisconnect',
@@ -4271,7 +4270,7 @@ if (typeof exports !== 'undefined') {
42714270
switch (command) {
42724271
case DIGITAL_MESSAGE:
42734272
this._logger.info('processMultiByteCommand digital:', channel, commandData[1], commandData[2]);
4274-
this.processDigitalMessage(channel, commandData[1], commandData[2]);
4273+
this._options.handleDigitalPins && this.processDigitalMessage(channel, commandData[1], commandData[2]);
42754274
break;
42764275
case REPORT_VERSION:
42774276
this._firmwareVersion = commandData[1] + commandData[2] / 10;
@@ -4363,7 +4362,6 @@ if (typeof exports !== 'undefined') {
43634362
break;
43644363
case ANALOG_MAPPING_RESPONSE:
43654364
this.processAnalogMappingResponse(sysexData);
4366-
this.emit(BoardEvent.BEFOREREADY);
43674365
break;
43684366
default:
43694367
this.emit(BoardEvent.SYSEX_MESSAGE, {
@@ -4468,7 +4466,14 @@ if (typeof exports !== 'undefined') {
44684466
}
44694467

44704468
if (!this._isReady) {
4471-
this.enableDigitalPins();
4469+
if (this._options.initialReset) {
4470+
this.systemReset();
4471+
}
4472+
if (this._options.handleDigitalPins) {
4473+
this.enableDigitalPins();
4474+
} else {
4475+
this.startup();
4476+
}
44724477
}
44734478
};
44744479

@@ -4942,7 +4947,9 @@ if (typeof exports !== 'undefined') {
49424947
login: 'admin',
49434948
password: 'password',
49444949
autoReconnect: false,
4945-
multi: false
4950+
multi: false,
4951+
initialReset: false,
4952+
handleDigitalPins: true
49464953
};
49474954
}
49484955

dist/webduino-base.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/classes/webduino.Board.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h2>Constructor</h2>
159159
<div class="meta">
160160
<p>
161161
Defined in
162-
<a href="../files/src_core_Board.js.html#l67"><code>src&#x2F;core&#x2F;Board.js:67</code></a>
162+
<a href="../files/src_core_Board.js.html#l66"><code>src&#x2F;core&#x2F;Board.js:66</code></a>
163163
</p>
164164

165165

docs/data.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
"extension_for": [],
251251
"namespace": "webduino",
252252
"file": "src/core/Board.js",
253-
"line": 67,
253+
"line": 66,
254254
"description": "An abstract development board.",
255255
"is_constructor": 1,
256256
"params": [
@@ -816,7 +816,7 @@
816816
"classitems": [
817817
{
818818
"file": "src/core/Board.js",
819-
"line": 34,
819+
"line": 33,
820820
"description": "Message command bytes (128-255/0x80-0xFF)\nhttps://github.com/firmata/protocol/blob/master/protocol.md",
821821
"class": "webduino.Board"
822822
},
@@ -2345,7 +2345,7 @@
23452345
"warnings": [
23462346
{
23472347
"message": "Missing item type\nMessage command bytes (128-255/0x80-0xFF)\nhttps://github.com/firmata/protocol/blob/master/protocol.md",
2348-
"line": " src/core/Board.js:34"
2348+
"line": " src/core/Board.js:33"
23492349
}
23502350
]
23512351
}

docs/files/src_core_Board.js.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ <h1>src/core/Board.js <small>File</small></h1>
122122
STRING_MESSAGE: &#x27;stringMessage&#x27;,
123123
SYSEX_MESSAGE: &#x27;sysexMessage&#x27;,
124124
PIN_STATE_RESPONSE: &#x27;pinStateResponse&#x27;,
125-
BEFOREREADY: &#x27;beforeReady&#x27;,
126125
READY: &#x27;ready&#x27;,
127126
ERROR: &#x27;error&#x27;,
128127
BEFOREDISCONNECT: &#x27;beforeDisconnect&#x27;,
@@ -357,7 +356,7 @@ <h1>src/core/Board.js <small>File</small></h1>
357356
switch (command) {
358357
case DIGITAL_MESSAGE:
359358
this._logger.info(&#x27;processMultiByteCommand digital:&#x27;, channel, commandData[1], commandData[2]);
360-
this.processDigitalMessage(channel, commandData[1], commandData[2]);
359+
this._options.handleDigitalPins &amp;&amp; this.processDigitalMessage(channel, commandData[1], commandData[2]);
361360
break;
362361
case REPORT_VERSION:
363362
this._firmwareVersion = commandData[1] + commandData[2] / 10;
@@ -449,7 +448,6 @@ <h1>src/core/Board.js <small>File</small></h1>
449448
break;
450449
case ANALOG_MAPPING_RESPONSE:
451450
this.processAnalogMappingResponse(sysexData);
452-
this.emit(BoardEvent.BEFOREREADY);
453451
break;
454452
default:
455453
this.emit(BoardEvent.SYSEX_MESSAGE, {
@@ -554,7 +552,14 @@ <h1>src/core/Board.js <small>File</small></h1>
554552
}
555553

556554
if (!this._isReady) {
557-
this.enableDigitalPins();
555+
if (this._options.initialReset) {
556+
this.systemReset();
557+
}
558+
if (this._options.handleDigitalPins) {
559+
this.enableDigitalPins();
560+
} else {
561+
this.startup();
562+
}
558563
}
559564
};
560565

examples/basic.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
// 'url': 'wa1501.local'
3737
// });
3838

39-
board.on(webduino.BoardEvent.BEFOREREADY, function () {
40-
console.log('board beforeReady');
41-
});
42-
4339
board.on(webduino.BoardEvent.READY, function() {
4440
console.log('board ready');
4541
led = new webduino.module.Led(board, board.getDigitalPin(13));

examples/node/basic.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ board = new webduino.WebArduino('device_id');
3535
// 'url': 'wa1501.local'
3636
// });
3737

38-
board.on(webduino.BoardEvent.BEFOREREADY, function () {
39-
console.log('board beforeReady');
40-
});
41-
4238
board.on(webduino.BoardEvent.READY, function () {
4339
console.log('board ready');
4440
led = new webduino.module.Led(board, board.getDigitalPin(13));

src/board/Bit.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
login: 'admin',
3232
password: 'password',
3333
autoReconnect: false,
34-
multi: false
34+
multi: false,
35+
initialReset: false,
36+
handleDigitalPins: true
3537
};
3638
}
3739

@@ -52,6 +54,7 @@
5254
});
5355

5456
Bit.DEFAULT_SERVER = 'wss://ws.webduino.io:443';
57+
Bit.SERVER_CHINA = 'wss://ws.webduino.com.cn';
5558

5659
proto.startup = function () {
5760
this._isReady = true;

0 commit comments

Comments
 (0)