nodeserver/src/local/App.js
/* This function updates a ZigBee NCP */
This function updates a ZigBee NCP
This function updates a ZigBee NCP
function updateConnectedZigBeeNCP(ZigBeeNCP, imageToUpdateTo, callback) {
  var flashCommand = 'python ' + pyScriptPath + '/ncp.py flash -p ' + ZigBeeNCP.port + ' -f ' + imageToUpdateTo;
  Logger.server.log('info', 'p.py flash: starting update: ' + ZigBeeNCP.port + ' ' + imageToUpdateTo);
  ncpSubProcess = child_process.exec(flashCommand, function(error, stdout, stderr) {
    ncpSubProcess = null;
    if (error) {
      Logger.server.log('error', 'exec error: ncp.py flash: ' + error);
      callback(true);
    }
    if (stderr) {
      Logger.server.log('error', 'ncp.py flash: ' + stderr);
      callback(true);
    }
    Logger.server.log('info', 'ncp.py flash: ' + stdout);
    callback(false);
  }.bind(this));
}
function updateConnectedZigBeeNCP ( ZigBeeNCP , imageToUpdateTo , callback ) { var flashCommand = 'python ' + pyScriptPath + '/ncp.py flash -p ' + ZigBeeNCP . port + ' -f ' + imageToUpdateTo ; Logger . server . log ( 'info' , 'p.py flash: starting update: ' + ZigBeeNCP . port + ' ' + imageToUpdateTo ) ; ncpSubProcess = child_process . exec ( flashCommand , function ( error , stdout , stderr ) { ncpSubProcess = null ; if ( error ) { Logger . server . log ( 'error' , 'exec error: ncp.py flash: ' + error ) ; callback ( true ) ; } if ( stderr ) { Logger . server . log ( 'error' , 'ncp.py flash: ' + stderr ) ; callback ( true ) ; } Logger . server . log ( 'info' , 'ncp.py flash: ' + stdout ) ; callback ( false ) ; } . bind ( this ) ) ; }
This function updates a ZigBee NCP
This function updates a ZigBee NCP