Calling pm_handler_secure_on_connection for every BLE event

In pm_handler_secure_on_connection, I see that it only looks for BLE_GAP_EVT_CONNECTED events if PM_HANDLER_SEC_DELAY_MS is not in use. I also see the comment "In normal circumstances, this function should be called for every BLE event." What is the reason for the latter? What are the circumstances where I can just call it when a BLE_GAP_EVT_CONNECTED event is received? 

Parents
  • Hi,

    That statement is likely for ease of use, and if you l look at how it is used in example projects, it is called as one of the first things in the BLE event handler function. Specifically, pm_handler_secure_on_connection() only handles the BLE_GAP_EVT_CONNECTED event. For all other events, it returns without doing anything. In other words you can choose to filter and only call it for BLE_GAP_EVT_CONNECTED events, but that is unnecessary.

Reply
  • Hi,

    That statement is likely for ease of use, and if you l look at how it is used in example projects, it is called as one of the first things in the BLE event handler function. Specifically, pm_handler_secure_on_connection() only handles the BLE_GAP_EVT_CONNECTED event. For all other events, it returns without doing anything. In other words you can choose to filter and only call it for BLE_GAP_EVT_CONNECTED events, but that is unnecessary.

Children
Related