2 Replies Latest reply on Mar 24, 2015 11:07 AM by shari.holness

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

    shari.holness

      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?