ws-slave.js
function writeRaw(peripheralId, serviceUuid, uuid, data, withoutResponse, callback){
  //todo catch exceptions
  var handle = servicesCache[peripheralId].services[serviceUuid].characteristics[uuid].handle;
  var peripheral = peripherals[peripheralId];

  //if not connected, connect
  checkConnected(peripheral, function(){
    peripheral.writeHandle(handle, new Buffer(data,'hex'), withoutResponse, function(error){
      if (error) {
        debug('Write handle error! '. red + error);
      }
      debug('write handle sent ' + peripheralId + ' : ' + serviceUuid + ' : ' + uuid )
      sendEvent({
         type: 'write',
         peripheralId: peripheralId,
         serviceUuid: serviceUuid,
         characteristicUuid: uuid
      });

    });
  })
}
function writeRaw(peripheralId, serviceUuid, uuid, data, withoutResponse, callback){
  //todo catch exceptions
  var handle = servicesCache[peripheralId].services[serviceUuid].characteristics[uuid].handle;
  var peripheral = peripherals[peripheralId];

  //if not connected, connect
  checkConnected(peripheral, function(){
    peripheral.writeHandle(handle, new Buffer(data,'hex'), withoutResponse, function(error){
      if (error) {
        debug('Write handle error! '. red + error);
      }
      debug('write handle sent ' + peripheralId + ' : ' + serviceUuid + ' : ' + uuid )
      sendEvent({
         type: 'write',
         peripheralId: peripheralId,
         serviceUuid: serviceUuid,
         characteristicUuid: uuid
      });

    });
  })
}
function writeRaw ( peripheralId , serviceUuid , uuid , data , withoutResponse , callback ) { //todo catch exceptions var handle = servicesCache [ peripheralId ] . services [ serviceUuid ] . characteristics [ uuid ] . handle ; var peripheral = peripherals [ peripheralId ] ; //if not connected, connect checkConnected ( peripheral , function ( ) { peripheral . writeHandle ( handle , new Buffer ( data , 'hex' ) , withoutResponse , function ( error ) { if ( error ) { debug ( 'Write handle error! ' . red + error ) ; } debug ( 'write handle sent ' + peripheralId + ' : ' + serviceUuid + ' : ' + uuid ) sendEvent ( { type : 'write' , peripheralId : peripheralId , serviceUuid : serviceUuid , characteristicUuid : uuid } ) ; } ) ; } ) }
write by handle
write by handle