Communication with another BLE device

Hello all,

I am developing an application to communicate 2 BLE devices, one of them is a mobile phone.
I need to send an arrays of bytes (APDUs) and receive the response from the other BLE device. I am using a combination of Bluetooth Central and Bluetood Serial plugins, but when I write the command I only receive an “OK”.

Are there some way of have a response from the other device when a command is send?

this.ble.connect(this.deviceID).subscribe(peripheralData => {
console.log(peripheralData.characteristics);
this.characteristics = peripheralData.characteristics;
this.connecting = false;

 var data = new Uint8Array(5);
data[0] = -78;
data[1] = 2;
data[2] = 20;
this.bluetoothSerial.write(data.buffer).then((deviceData)=> {
    // not sure of returning value, probably a boolean
    console.log(deviceData);

    }, error => {
        console.log(error);
    }
);


this.navCtrl.pop();

},
peripheralData => {
  console.log('disconnected');
  });
}

Could you please help me with that? Thank you in advance.

1 Like