Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise( (resolve, reject) =>{
BleManager.writeWithoutResponse(this.peripheralId, this.writeWithoutResponseServiceUUID[index], this.writeWithoutResponseCharacteristicUUID[index], data)
.then(() => {
console.log('Write success: ',data);
resolve();
})
.catch((error) => {
console.log('Write failed: ',data);
reject(error);
});
});
}
return new Promise( (resolve, reject) =>{
BleManager.writeWithoutResponse(this.peripheralId, this.writeServiceUUID, this.writeCharacteristicUUID, data)
.then(() => {
console.log('Write success: ',data);
resolve();
})
.catch((error) => {
console.log('Write failed: ',data);
reject(error);
});
});