This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device manager timeout handler and related event

Hi,

I'm using device manager for bonding starting from a sample application in the SDK.

I see that the DM_EVT_CONNECTION is raised before the BLE_GAP_EVT_CONNECTED but the dm event handler needs to start a timer for securing the link because it needs a valid m_conn_handle that is set only in the BLE_GAP_EVT_CONNECTED. Why these two events are raised in reverse order ? Can you explain me it better ?

I have this question because we are developing a board that haven't the externel oscillator for RTC1, so I can't use app timer and I need to remove the timer used to execute dm timeout handler. Is the only solution to use a TIMER1/2 or is there another solution to do that ?

Thanks, Paolo.

Parents
  • Hi ppatierno,

    In most of our examples we did not have the dependency of the order in which the event_handlers for modules are called. If your example needs that m_conn_handle needs to be update in dm_event_handler then you can update it by just adding something like this

    case DM_EVT_CONNECTION:
        m_conn_handle = p_event->event_param.p_gap_param->conn_handle;
    

    The requirement of the order in examples is depending on particular use case.

    or even change the order in which the event handlers are called inside ble_evt_dispatch

  • I think the security of the link does not effect the service discovery. you can do a service discovery on both secure and open link. This is ok as service discovery information is meant to be public. After having some thinking, I am not really sure for the reason of this delay. I will have to dig more into apple specifications. I do not have the setup to try it here, my opinion is it should just work fine if you do not use this delay and start the security setup immediately

Reply
  • I think the security of the link does not effect the service discovery. you can do a service discovery on both secure and open link. This is ok as service discovery information is meant to be public. After having some thinking, I am not really sure for the reason of this delay. I will have to dig more into apple specifications. I do not have the setup to try it here, my opinion is it should just work fine if you do not use this delay and start the security setup immediately

Children
No Data
Related