Is it ok to transmit/receive data over BLE in the "Event Close" state/BLE stack mode?

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

cross mob
Anonymous
Not applicable

I'm working on one of the example projects from the 100 Projects in 100 Days set of projects - Dynamic Broadcaster, Project #9 www.cypress.com/ - and instead of the broadcasting data generated by the firmware (a counter), I want my device to broadcast data read from the proximity sensor (CapSense). When I added the CapSense component and code into the Dynamic Broadcaster project, the proximity sensing portion worked fine but as the proximity sensor data changed, none of those changes were being broadcasted which I later found was due to the portion of the code that broadcasts the data becoming inaccessible due to the BLE state not being active which doesn't meet the necessary condition to execute that section of code.

   

[Further details if needed: In the DynamicADVPayloadUpdate() function, when the BLE Subsystem (BLESs) state was checked (Condition: CyBle_GetBleSsState() == CYBLE_BLESS_STATE_ACTIVE), it was never active, so naturally did not execute anything it encapsulated which was the code to broadcast the sensor data.]

   

So that was my problem. Now, the state that is detected when CyBle_GetBleSsState() is called at that point is CYBLE_BLESS_STATE_EVENT_CLOSE. I added an additional condition to include accepting this state if encountered as well since after reading up on it in the BLE document (www.cypress.com/ Pg. 52-53), this state seems just as fine as if the BLESs were active but I wanted to ask to make sure I wasn't missing anything as I am very new to all of this. Is there anything I should be concerned about or note if I allow BLE data transmission when the BLESs is in the CYBLE_BLESS_STATE_EVENT_CLOSE state versus the active state?

0 Likes
1 Solution
FNUK_06
Employee
Employee
5 sign-ins Welcome!

CyBle_GetBleSsState API will return CYBLE_BLESS_STATE_EVENT_CLOSE continuously if the BLE block is not configured in low power mode. In which case, you can update the advertisement payload any time.

   

The reason for updating the advertisement payload at CYBLE_BLESS_STATE_ACTIVE is to make sure we don't update the radio registers when the BLE block is not active (saves power).

   

Details of each of these states and how to use them to build a low power system will be explained in an application note that is scheduled to be released by next week or so.

View solution in original post

0 Likes
2 Replies
FNUK_06
Employee
Employee
5 sign-ins Welcome!

CyBle_GetBleSsState API will return CYBLE_BLESS_STATE_EVENT_CLOSE continuously if the BLE block is not configured in low power mode. In which case, you can update the advertisement payload any time.

   

The reason for updating the advertisement payload at CYBLE_BLESS_STATE_ACTIVE is to make sure we don't update the radio registers when the BLE block is not active (saves power).

   

Details of each of these states and how to use them to build a low power system will be explained in an application note that is scheduled to be released by next week or so.

0 Likes
Anonymous
Not applicable

Ok, that makes sense. Thanks for clarifying that for me 🙂

0 Likes