This repository was archived by the owner on Jul 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ MetaWear.prototype.writeCommandCharacteristic = function (data, callback) {
7777 } ) ;
7878} ;
7979
80- MetaWear . prototype . connectAndSetUp = function ( callback ) {
80+ MetaWear . prototype . connectAndSetUp = function ( callback , initBuf ) {
8181 var initializeCallback = ( typeof callback === 'function' ) ? callback : function ( ) { } ;
8282
8383 NobleDevice . prototype . connectAndSetUp . call ( this , function ( error ) {
@@ -96,6 +96,10 @@ MetaWear.prototype.connectAndSetUp = function (callback) {
9696 if ( this . hasCharacteristic ( METAWEAR_SERVICE_UUID , METAWEAR_COMMAND_UUID ) ) {
9797 this . _characteristics [ METAWEAR_SERVICE_UUID ] [ METAWEAR_COMMAND_UUID ] . setMaxListeners ( 50 ) ;
9898 }
99+ // Deserialize if buffer provided
100+ if ( initBuf ) {
101+ MetaWear . mbl_mw_metawearboard_deserialize ( this . board , initBuf , initBuf . length ) ;
102+ }
99103 // Setup the CPP SDK
100104 MetaWear . mbl_mw_metawearboard_initialize ( this . board , MetaWear . FnVoid_MetaWearBoardP_Int . toPointer ( function onInitialize ( board , code ) {
101105 // Adjust link speed for macOS only since we can't adujust it elsewhere
You can’t perform that action at this time.
0 commit comments