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?
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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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.
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/blob/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_ibeacon.js to decode the iBeacon info.
That's the raw advertising data - you can see the manufacturer/manufacturerData in there, so I think it is correct.
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.