3
\$\begingroup\$

I have a requirement where the diagnostics of a vehicle has to be carried out using BLE. The number of read/write parameters would be over 300.

I had worked on BLE devices in a wearable application where the attributes were around 12-15 (using GATT).

  • Is BLE the right choice for over 300 parameters in different profiles?
  • What kind of BLE profile and UUID type can be used for this?
\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

What you're saying is that you'd want some type of "CLI" or command structure to access the various parameters through a single characteristic. I think that's definitely doable and you can use the already existing BLE UART examples provided by companies like Nordic in their SDK.

You'll definitely have to think about how your commands will be structured. For instance.

[Command][Command ID3][Command ID2][Command ID1][Command ID0]

Where each bracket is 1 byte. The first byte would be a "read" command and the remaining would be the parameter of what piece of the 300 params you want to access. I feel like there has to be some good libraries out there that help with this but I can't find any from a quick googling (in the past I've used home-grown ones)

You would use the same UUID as provided by the vendor for the UART characteristic. The problem here is, especially if you care about more "real time" results, is that you wouldn't be able to subscribe for notifications to this characteristic and then know what exactly changed.

The solution for that would to create a new service and have as many characteristics as necessary to notify that something has changed and it should be read over the BLE UART characteristic/service. Choosing a UUID for this is literally using a random generated UUID that doesn't fall in the Bluetooth SIG reserved UUID range.

Remember, the more services and characteristics you add, the more it weighs down on the resources of the uC. Depending on whatever else is going on in your code, you may have to be mindful of that!

\$\endgroup\$
3
  • \$\begingroup\$ Also be sure to decrease the connection interval to minimum for the fastest transfers. Just figured that out the hard way after some extended head scratching! \$\endgroup\$
    – jaredwolff
    Commented Jul 26, 2018 at 16:19
  • \$\begingroup\$ Not necessarily a single characteristic, it can be multiple, Im asking for which profile I should go with? \$\endgroup\$ Commented Jul 27, 2018 at 5:58
  • \$\begingroup\$ There is likely no off the shelf “profile” that can do what you want. As suggested either UART (over GATT) with a command structure of some kind of service with “buckets” of data that are logically put together into characteristics because they all belong to one subsystem. You’ll have to play with it and see what you find works best. \$\endgroup\$
    – jaredwolff
    Commented Jul 28, 2018 at 1:24
1
\$\begingroup\$

With that many parameters, I would set up wireless serial link between the on board monitor and the controller. Create a simple question/answer protocol and go. I think that is the simplest way to get going.

As you did not mention your platform, here are an assortment of app notes and examples dealing with BLE uarts:

\$\endgroup\$
4
  • \$\begingroup\$ Tunneling through a channel likely does make sense, however it may be worth batching common responses rather than asking a distinct question for each. Even if latency is minimal it's best to use the full MTU of each packet with data, and if the data is ordered you don't have to waste space identifying the items. Another nice thing is that the scheme has some portability to other transports that might someday be used as well or instead. \$\endgroup\$ Commented Jul 24, 2018 at 15:13
  • \$\begingroup\$ Create a simple question/answer protocol and go, u mean to say,for each parameters or common to all? \$\endgroup\$ Commented Jul 25, 2018 at 5:43
  • \$\begingroup\$ So I will have to use only Tx and Rx characteristics to setup a communication instead of creating 300 custom characteristic, am I correct? Can you also let me know the disadvantage of using too many attributes? \$\endgroup\$ Commented Jul 25, 2018 at 5:44
  • \$\begingroup\$ @MahendraGunawardena - please don't make such absurdly trivial edits to old questions. Putting bullet points in front of what were already quiet clearly list items isn't worth reviewer's time, and is a wholly unjustified reason to bump this question's page to the top of the queue. \$\endgroup\$ Commented Mar 18, 2019 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.