BLE read issue


#1

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


#2

I have the same problem, I can write, but immediate disconnect and rise an error, but i´m thinking is a problem related to how byteArray is managed, i need send an hex value witch act like a passkey but when write this value device end connection…I don’t know what i’m doing wrong xD