Is there a code example of a Time Service Broadcaster using Advertisements only?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

I'm trying to create a BLE Broadcaster node that publishes the Time Service once a minute using only Advertiser packets only.  Is there a code example?

Note:  I do not want to support connections on this node.  I realize that I can supply a UIDD with data as part of the Advertiser packet.  I also have already created an Observer-only BLE node that can decode the advertisement data.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
1 Solution
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Len,

Have you gone through this Dynamic Broadcaster (Day 009) code example in the below link?

PSoC-4-BLE/100_Projects_in_100_Days at master · cypresssemiconductorco/PSoC-4-BLE · GitHub

Hope it helps ! If not please update the thread.

Thanks

Ganesh

View solution in original post

0 Likes
3 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Len,

Have you gone through this Dynamic Broadcaster (Day 009) code example in the below link?

PSoC-4-BLE/100_Projects_in_100_Days at master · cypresssemiconductorco/PSoC-4-BLE · GitHub

Hope it helps ! If not please update the thread.

Thanks

Ganesh

0 Likes

Ganesh,

Thank you.  I'll check it out.  I'll have to convert it to PSoC6 but the principles should be there for the most part.

I did find information about changing the advertisement data such as code frags below that appear to work:

*((uint32_t *)&cy_ble_discoveryData[config_idx].advData[CY_BLE_ADV_PKT_0_INDEX_SERVICE_DATA_IMMEDIATE_ALERT+4]) = adv_count;  // change the intended data.

Cy_BLE_GAPP_UpdateAdvScanData(&cy_ble_discoveryModeInfo[config_idx]);  // Signal the new advData to the BLE stack.

Len.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Ganesh,

The PSoC4 API (CyBle_GapUpdateAdvData() ) is a little different than the PSoC6 BLE API (Cy_BLE_GAPP_UpdateAdvScanData() ) but basically the same.

Thanks.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes