@@ -2496,7 +2496,7 @@ Paho.MQTT = (function (global) {
24962496} ) ( window ) ;
24972497
24982498var webduino = webduino || {
2499- version : '0.4.22 '
2499+ version : '0.4.23 '
25002500} ;
25012501
25022502if ( typeof exports !== 'undefined' ) {
@@ -3948,7 +3948,10 @@ if (typeof exports !== 'undefined') {
39483948 DISCONNECT : 'disconnect'
39493949 } ;
39503950
3951- // Message command bytes (128-255/0x80-0xFF)
3951+ /**
3952+ * Message command bytes (128-255/0x80-0xFF)
3953+ * https://github.com/firmata/protocol/blob/master/protocol.md
3954+ */
39523955 var DIGITAL_MESSAGE = 0x90 ,
39533956 ANALOG_MESSAGE = 0xE0 ,
39543957 REPORT_ANALOG = 0xC0 ,
@@ -4040,14 +4043,19 @@ if (typeof exports !== 'undefined') {
40404043 }
40414044
40424045 function onMessage ( data ) {
4043- var len = data . length ;
4046+ try {
4047+ var len = data . length ;
40444048
4045- if ( len ) {
4046- for ( var i = 0 ; i < len ; i ++ ) {
4047- this . processInput ( data [ i ] ) ;
4049+ if ( len ) {
4050+ for ( var i = 0 ; i < len ; i ++ ) {
4051+ this . processInput ( data [ i ] ) ;
4052+ }
4053+ } else {
4054+ this . processInput ( data ) ;
40484055 }
4049- } else {
4050- this . processInput ( data ) ;
4056+ } catch ( err ) {
4057+ console . error ( err ) ;
4058+ throw err ;
40514059 }
40524060 }
40534061
@@ -5550,12 +5558,6 @@ chrome.bluetoothSocket = chrome.bluetoothSocket || (function (_api) {
55505558 }
55515559 } ) ;
55525560
5553- proto . startup = function ( ) {
5554- this . _isReady = true ;
5555- this . getPin ( 34 ) . setMode ( 2 ) ; //set analogNum 6 = pin34
5556- this . emit ( webduino . BoardEvent . READY , this ) ;
5557- } ;
5558-
55595561 Bit . DEFAULT_SERVER = 'wss://ws.webduino.io:443' ;
55605562
55615563
0 commit comments