this is my scan code that write and read some data , write is happen but when i want to read nothing happedn ? what is the problem ?
scan() {
let that = this;
this.ble.scan([], 1).subscribe(d=> {
this.devices = d;
this.l = d.id.toString();
this.ble.connect(d.id).subscribe(p => {
that.status = "connected"
let lastChar = p.characteristics[p.characteristics.length - 1];
let serviceId = lastChar.service;
let chUUID = lastChar.characteristic;
// this.ble.write(d.id.toString(), serviceId, chUUID, this.stringToBytes("HOPE AGAIN")).then(() => {
// })
this.ble.startNotification(d.id, serviceId, chUUID).subscribe(p => {
that.status = "NOTI";
// this.cdata = typeof p;
this.ble.read(d.id, serviceId, chUUID).then(p => {
that.status = "CHANGEEED";
})
})
// this.connected = "SUCESSFULLY CONNECTED TO ";
// this.cdata = JSON.stringify(p);
})
})
thanks