I am able to make a BLE connection with the hardware. By using service UUID and characteristics UUID I am able to receive data from the hardware through start notification function. But when I try to send data to the hardware its showing error [Write error status-3] as shown in the below code.
BleManager.retrieveServices(peripheral.id).then((peripheralInfo) => {
console.log(peripheralInfo);
var service = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';
var WriteCharacteristic = '6e400002-b5a3-f393-e0a9-e50e24dcca9e';
var ReadCharacteristic = '6e400003-b5a3-f393-e0a9-e50e24dcca9e';
setTimeout(() => {
// receiving data from hardware
BleManager.startNotification(peripheral.id, service, ReadCharacteristic).then(() => {
console.log('Started notification on ' + peripheral.id);
setTimeout(() => {
// sending data to the hardware
BleManager.write(peripheral.id, service, WriteCharacteristic, [1,95]).then(() => {
console.log('Writed NORMAL crust');
});
}, 500);
}).catch((error) => {
console.log('Notification error', error);
});
First faced some problems with characteristics not found. After some changes, I am getting error as
Write error Status - 3
I am not able to find any solution for this error. Thank you in advance