i am trying to read out the advertisement of a ruuvi tag with android. I am building an application with ionic 4 and cordova. Program language is typescript/angular.
Iām not familiar with Ionic or Cordova, but it seems that your application gives you the largest possible payload, with advertisement and scan response for a total of 31 + 31 bytes.
The 0x02 01 06 is a mandatory header in BLE advertisement packet, it means 02 -> 2 bytes of data (type, payload, not counting length byte) 01 -> With the type of Flags 06 -> LE General Discoverable Mode (2) + BR/EDR not supported. (4)
The 0x11 FF 99 04 is manufacturer specific data header, it means 11 -> 17 bytes of data, including header, not including length byte FF -> Manufacturer specific data 99 04 -> Little endian, is actually 0499. Ruuvi Innovations BLE SIG number.
Rest of the data is Ruuvi format 3, full description of data format is here.
Trailing NULLs are given to you by the application and are not sent by RuuviTag
I once toyed around with doing a desktop app with Angular and Electron, and later abandoned the project as the bluetooth library Noble is not very reliable across different platforms.
Anyway, the parsers I wrote are at https://github.com/ojousima/ojousima.ruuvi_endpoints.ts ,
essentially the parsers take a look into first data payload byte (check src/index.ts) and then return a parsers for the given data format