4 ms·
The entire bluetooth ecosystem is an enigma, and I say that as someone that has spent the last couple of years professionally developing embedded systems primar
by flyingcircus3 9y ago
The entire bluetooth ecosystem is an enigma, and I say that as someone that has spent the last couple of years professionally developing embedded systems primarily using Nordic Semiconductor parts, one of the flagship companies of the industry.
It is one of the most reviled protocols by developers, when they are the users. Yet, the basic goal of Bluetooth has always been to vertically integrate the entire OSI model, from Application to Physical to Application. So one might say they've taken a bigger bite than they can stomach.
I haven't dabbled with 5 yet, but I believe I could effectively tutor any HNer in 4.2, if they were willing to put the effort that learning anything worthwhile requires.
One of the largest paradigm shifts coming from the TCP/IP stack world, to the Bluetooth world, is that you are inherently creating application level "software", but since its highly embedded, "firmware" developers end up doing a big chunk of that work. Ew.
For instance in BLE, or Bluetooth Low Energy, to integrate a heart rate monitoring application, the Bluetooth specification defines a heart rate service. As the name implies, the heart rate service encapsulates all of the information that is pertinent to monitoring hearts, given sufficient sensors.
A service is made up of characteristics. As the name implies, characteristics are data structures that encapsulate a single piece of information that would likely be useful at the application level. In the case of our heart rate monitor, it is simply the frequency at which your heart beats. Your heart rate.
In the parlance of Model View Controller, the actual sensor logic to provide that heart rate, is traditional embedded development, and out of the scope of Bluetooth.
However, that Model's main deliverable to our microController is that heart rate. We don't care how he got it, we trust him to measure hearts.
At least in Nordic's implementations, and I would assume others, there is a callback you register, associated with each characteristic. This callback's job is to transfer the heart rate from the model, to the user of said heart. So the callback is calling the highest level client call into the model, uint16_t myHeartRate = getHeartRate(); Then the heart rate value is given to the radio subsystem firmware, which is almost always code written and owned by the chip vendor, whether thats TI, or Nordic, or whoever.
So, in summary, if you find that you've focussed on the View side of the MVC world for your entire career, you will likely find both the model and the controller very confusing. Your first instinct, like all novices, will be to say "I'll show these guys how its done". So you'll eschew your own Design Patterns, and attempt to bring the model and the controller back into the view. Let me know how that works out. On the other hand, if you accept that iPhones and Androids are actually just Views, you may come to realize that a separation of concerns was a pretty ok idea after all.
- nradov 9y agoHow does Bluetooth compare to ANT+ in that regard?
- flyingcircus3 9y agoWell, I kind of think of it as a distribution, just like debian, or mint, or whatever. Even though they all say their the best Linux, as if that is somehow tautological. The nRF52832 can do both Bluetooth and ANT, because they share common lower level protocols. I haven't used ANT in a project yet, but I've worked at places that have, just on other teams. It has a more restrictive license, and you have to sign NDAs to even get the key binaries. Thats not to say that Nordic's mainline BLE is open source, but the closed source binaries are freely distributed. My educated guess though is that Bluetooth developers have "tricked themselves" into thinking they've mastered a design, when they've actually just learned a little more about todays implementation. But as any nordic developer knows, focusing for any measureable amount of time on SDK12 just means you're gonna be super pissed when you hear about SDK13, and thats because nRF decided to totally rewrite SDK14, which will eventually fail hard enough long enough to convince them to spin up into SDK15. But like they always say, Trust us, we only hire the best. Edit: something something word word
- mafaneh 9y agoWhat you're describing focuses too much on the implementation on a specific platform. It's true that each vendor will provide their own way of doing things (perfectly normal), and things will change as well (also expected). But you have to also keep in mind that there is a lot that can be learned about the Bluetooth protocol and technology itself that is independent of the platform its implemented on. If the developer does not understand the protocol and specification, then they will end up getting sucked into the implementation of the specific platform. I don't work for Nordic nor have any affiliation with them, but from my experience, their support is top-notch and I love the community interaction and support they offer through their DevZone site. No vendor is perfect, so it goes without saying that there will always be pros and cons.
- 9y ago