Closed mzarella closed 9 years ago
Yeah, that's a result of how the iOS CoreBluetooth API works. It hides the MAC address, and instead assigns a UUID to each BLE device it detects. These UUIDs are random and temporary; you run the same program again on the same device, you might get different ones.
Android gives you the proper MAC address.
@fredrikeldh But then how can I associate a randomly generated address with an object in the DB? Or rather, what's the proper way to associate a device with the information you want to present? It doesn't seem like device.address
is a reliable way to identify a device with information you want to present.
"proper" way? That's up for debate. If you have control over the devices' advertisements, you might add some Manufacturer Data, or some Service Data, which you can then read through device.advertisementData
.
I see you've mentioned Estimote, so I'll guess you're using iBeacons. In that case, I recommend using one of our iBeacon plugins. They will give you more permanent device identifiers.
https://forums.estimote.com/t/reading-more-than-one-uuid/1067
The callback to evothings.ble.startScan,
function deviceFound(device)
, is reading different addresses, i.e.device.address
is different depending on the phone. Has anyone ever ran into this?e.g.
iphone5c reads
E2B0A070...
iphone5s reads
B9401000...
iphone6 reads
C7EEF8AC...
and the android reads something that looks like a MAC address: `5F:C7:E2:FF:0A..."