• The getPrimaryService never gets fulfilled. Not sure what is going on here? There does not seem to be a way of adding a timeout?

    Once connected, the timeout is in the number of connection intervals taken I think. It's possible the Tilt just doesn't implement any service discovery so just ignores any requests - which would then result in a disconnection when Espruino tried to request them and never got s response. It would make sense for it to output all its data as advertising.

    The manufacturer data in the first code block - seems to wrong - as 76 is apple and the previous devices is an apple tv- and in the 2nd block of code - it is undefined for the Tilt - so I'm wondering if the previous values are getting set?

    I imagine it's actually pretending to be an Apple iBeacon, which is why it's using Apple's company ID. That's what https://github.com/baronbrew/tilt-scan/b­lob/master/tilt-scan.js seems to be detecting/doing.

    So what you'd want to do is basically just do the opposite of https://www.espruino.com/modules/ble_ibe­acon.js to decode the iBeacon info.

    What is data in BluetoothDevice: structure?

    That's the raw advertising data - you can see the manufacturer/manufacturerData in there, so I think it is correct.

    Can the device name be included in the BluetoothDevice: structure?

    It can, but doesn't have to be. There are 32 bytes of advertising data (IIRC) allowed, so I imagine it's pretty much all take up with iBeacon stuff and they decided not to include it.

About

Avatar for Gordon @Gordon started