3 ms·
You should seek out a primer of the general architecture. Its definitely a departure from IP networking. Here's a brief overview: Devices advertise their pre
by tmuir 10y ago
You should seek out a primer of the general architecture. Its definitely a departure from IP networking. Here's a brief overview:
Devices advertise their presence when they are not connected. The usual connection is one device to one client, although multiple simultaneous connections are possible. Clients can look at advertisement data to see what services the device offers. Once a client connects to a device, it can interrogate the device further.
A BLE device makes multiple pieces of data available individually, called characteristics. So if your device had a heartrate sensor and a battery, your bluetooth profile would likely have a heart rate characteristic and a battery level characteristic. A client that connects to this device could discover these characteristics, and read/write them, as well as set up notifications, so the device can asynchronously send the client data.
An IP based system treats its connection as a single pipe, whereas in a BLE system, on top of a single physical connection, you effectively plumb a separate pipe to each piece of information you make available to the client. Each characteristic has its own read and write callbacks, and each characteristic can be individually customized with things like read write notify permissions, data type, description, etc.
- Already__Taken 10y agoI just started a little BLE work to get into things. I've found it really odd there's a definitive list[1] of services that can be advertised. Why is it not just a specified key/value to advertise? Like "Health Thermometer" is crazy specific. [1]: https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx https://developer.bluetooth.org/gatt/services/Pages/Services...
- tmuir 10y agoYou can make custom services and characteristics. The nice thing about standard services is that 3rd party apps that know how to interact with those services can work out of the box.
- mschuster91 10y agoNope. Mi Bands (fitness trackers by Xiaomi), for example, use some weird scheme until you can access the heartbeat sensor. DRM and obfuscation is even present in these devices -...-
- tmuir 10y agoWell, there's certainly no requirement to adhere to in terms of access. Apple's HomeKit runs on BLE but has its own layers of pairing and encryption. I'll agree though that you are more likely to find compatibility on a development board level than in a commercial product.
- asimuvPR 10y agoThanks, really helpful info.
- tmuir 10y agoYou're welcome. It's always a treat when HN wades into the embedded world, and I can be the expert for a second.