cordova-plugin-bluetoothle icon indicating copy to clipboard operation
cordova-plugin-bluetoothle copied to clipboard

How to get manufacture special data from advertising data?

Open n1705771 opened this issue 5 years ago • 1 comments

Hi Sir,

in my ionic application, I set advertisingParams as:

var advertisingParams = {
      services: ['1234'],
      service: '1234',
      name: "my_email_address",
      mode: "balanced",
      connectable: false,
      timeout: 10000,
      txPowerLevel: "medium",
      manufacturerId: 0x004C,
      manufacturerSpecificData: "my_special_data",
      includeDeviceName: false
    }

I the scanner side, I have tried to use atob() to get the value of manufacturerSpecificData from advertising data, but it doesn't work. I also tried use btoa("my_special_data") to generate data, but could not find the similar data in advertising data.

Could you pleas help, how to extract manufacturerSpecificData from advertising data?

Thanks

n1705771 avatar May 03 '20 01:05 n1705771

Try using string to bytes and bytes to encoded string ad then pass that to manufacturerSpecificData

randdusing avatar May 03 '20 21:05 randdusing