ayman
ayman

Reputation: 1341

How can sensor data be embedded in the advertising packet of the TI SensorTag cc2650?

I'm trying to make the TI SensorTag (cc2650) connectionless (just constantly advertise sensor, like accelerometer, readings).

In the SensorTag.c file in the base SensorTag project, I can see the static uint8_t advertData[] but I'm not sure if I can put dynamic sensor data in there (or if that's the right approach or where to find the GAP_ADTYPE_* list if that's needed).

Upvotes: 1

Views: 2795

Answers (3)

Spav
Spav

Reputation: 1

When using the GAP type Manufacturer Specific Data, which is 0xFF, this must be followed by a Manufacturers UUID, just adding data without the UUID means that you could be advertising incorrectly. There does not seem to be a generic manufacturing UUID, that can be used at risk, and the SIG require $2500 to register a specific UUID. I am struggling with the same issue and encoding into GAP type 09 is looking like an option that should not upset anything or anyone.

More Information:

For me the answer turned out to be as recommended by the chip manufacturer (I am using CC2640), that is to use the chip manufacturers UUID with 2 bytes additional of identification so for a full AD I used the following

[ 1E FF 0D 00 XX XX <25 bytes of data> ]

It is used at risk as the additional bytes of identification may not be unique, but hopefully you have some way of confirming the payload is intact as well that should give you a reliable way of sending the data.

Upvotes: 0

Darko Djuric
Darko Djuric

Reputation: 754

Since you are using TI Stack, please find Simple BLE Observer & Simple BLE Broadcaster examples. If you don't want to create connection to the device it should be the way to go.

As stated in TI documentation

Observer is basically a device which scans for advertisement messages but cannot initiate connections. On the other hand, a Broadcaster is a device which sends advertisement messages but non-connectable.

You will find all that you need in example documentation and source code comments.

Upvotes: 0

Tim
Tim

Reputation: 1933

I do not know anything about this device so my answer will be quite general.

Yes you can broadcast your sensor's data through advertising, this way there is no need for the other devices to connect to see the sensor's value.

Here is the advertising data format as shown in the BLE 4.2 Core Spec, Vol 3, Part C, 11.1.

BLE advertising data format

Here what is interesting you is the last nested part, the AD Type and AD Data, and of course the length of these.

Basically what you want to do is, if you have a 4 bytes value, to set a length of 5 (bytes), 1 for the type and 4 for the data.

The type itself must be one of the GAP types defined here : Generic Access Profile. To advertise your own data you must chose the last one, Manufacturer Specific Data, which is 0xFF.

Concerning your source code and the TI stack that you are using I cannot really help you, however if it works the same way than the other stacks I've used then it's very likely that :

  1. You can put your data in advertData[]
  2. The GAP Type looks like GAP_ADTYPE_MANUFACTURER_SPECIFIC

Of course the length of the AD Structure has to be specified somewhere. Whether you specify the length of the whole packet or you just tell the stack the length of your data (in advertData) and it will compute (add 1) the length of the AD Structure.

Upvotes: 3

Related Questions