I am storing ADC readings in a custom characteristic CYBLE_GATT_HANDLE_VALUE_PAIR_T .val field. These ADC readings are made every 10 seconds. I want to include these ADC reading in my advertising packet and continually update my advertising packet to reflect the latest values of the ADC readings. Is it possible to do this?
Solved! Go to Solution.
Thanks roit. I will try this project right now.
One more question: I think I read somewhere that a BLE peripheral can connect with a central, then while remaining connected can start advertising again--although the peripheral will not be able to actually connect to a second central while still being connected to the first central. Is this correct?
You can start advertisement as a peripheral then when connected restart advertisement as a broadcaster (non-connectable)
AFAIK, the BLE stack only supports one connection at any one time (this may just be a limitation of Bluetooth.)
I have the advertising data updating with every new adc conversion. That's working great. But I haven't been able to get the BLE peripheral to connect to the central while broadcasting updated non-connectable advertising packets. The connection attempts keep timing out while the updated packets continue to broadcast. Any thoughts on which files and structures I might modify to do as you suggest, tom66? Thanks.
Hey Pat. I'm also working on similar things. I had a look on the Day009 project also. But i'm finding it difficult to update the advertising data. Can you help me with it?
I want to extract the data on the central side (ie myPsoc Board). So in the component configuration part do we have to do any specific changes for this? I have chosen a custom profile (Gat client and central) and rest all settings are default. I have the dongle continuously adverstising. I want to extract it's Local name etc using API's but i'm unable to achieve it. Also once i achieve it i can program the Dongle packet with custom data like yu did and receive it on the central side. Please help me if possible.
When you are broadcasting, you are essentially doing the non-connectable advertising. So, by definition, you cannot connect to it. 🙂
To make it connectable, go to your BLE component and change the role from broadcaster to profile with custom service. You can also change the Advertising type from the BLE component -> GAP Settings tab -> Advertisement settings -> change the type to connectable. You firmware should still work with this setting change but now you can connect to it too.
roit, thank you. But my goal is to have a peripheral advertise connectibly and ultimately connect to a central, call it central #1. Then, while still in connection with central#1, immediately start broadcast advertising non-connectibly. That way many other centrals can read my ADC conversion data in the peripheral's broadcast ad package while central #1 is still in connection with the peripheral. Is this possible?
I'm working on a similar project. I've built the DynamicBroadcaster project & it works fine.
How to I increase the number of bytes for the Manufacturer Specific Data ?
(I want to place 30 bytes )
The maximum payload for the entire advertisement packet is 31 bytes, which limits the amount of manufacturer data to 27 bytes at most. This is due to the required advertisement field spec, which dictates Length-Type-Value fields which incur 2 bytes of overhead, plus the Manufacturer Data field requires another 2 bytes of overhead for the 16-bit company ID.
For example, a 27-byte payload (0x00 through 0x1A) with a company ID of 0x0131 (Cypress) could look like the following:
1E FF 31 01 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A