Permalink
Browse files

fixing rest streams to api.rest callbacks

  • Loading branch information...
1 parent fa1b219 commit aeef5c55ac4639f5a3256043baf7905ec7f7e493 @soldair soldair committed Feb 27, 2014
Showing with 14 additions and 2 deletions.
  1. +3 −2 lib/api.js
  2. +11 −0 lib/commands/provision.js
View
@@ -40,6 +40,7 @@ module.exports = function(config,reconnect){
z.expectingStream[data.stream] = _cb;
streamKey = data.stream;
} else {
+
cb(data.error,data.data);
clearTimeout(timer);
}
@@ -145,11 +146,11 @@ module.exports = function(config,reconnect){
console.log('bound connection listener!');
o.connection.mdm.on('connection',function(stream){
- console.log('mdm got stream from connection listener')
+ console.log('mdm got stream from connection listener',stream.meta);
// the server has opened a stream from me.
if(stream.meta && stream.meta.type == "rest-stream") {
if(o.expectingStream[stream.meta.id]) {
- o.expectingStream[stream.meta.id](false,stream);
+ o.expectingStream[stream.meta.id](false,{data:stream});
delete o.expectingStream[stream.meta.id];
}
};
View
@@ -3,6 +3,17 @@ var serial = require('../serial');
module.exports = function(args,api,config,cb){
+/*
+MANUAL PROVISIONING BITLASH COMMANDS
+
+mesh.config(<Scout ID>, <Troop ID>)
+mesh.key("<mesh encryption key with max 16 chars>")
+scout.sethqtoken("<HQ Token String>")
+wifi.config("<Access point name>", "<Access point password>")
+wifi.dhcp // if dhcp
+wifi.reassociate()
+*/
+
var ser = serial();
var devices;
var troops;

0 comments on commit aeef5c5

Please sign in to comment.