This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calling on_connect causes problems in SDK 14

Hi

I'm migrating to SDK14 currently. My program seems to hit an infinite loop (or something of the sort) after I call my_service_on_connect() from my_service_on_ble_evt. Here are the two functions:

void ble_my_service_on_ble_evt(ble_evt_t const *p_ble_evt, void *context) {
	ble_my_service_t *p_my_service = (ble_my_service_t *) p_my_service;
	switch (p_ble_evt->header.evt_id)
	{
	    case BLE_GAP_EVT_CONNECTED:
	    	ble_my_service_on_connect(p_my_service, p_ble_evt);
	        break;
	    case BLE_GAP_EVT_DISCONNECTED:
	    	ble_my_service_on_disconnect(p_my_service, p_ble_evt);
	        break;
	    default:
	        // No implementation needed.
	        break;
	}
}

static void ble_my_service_on_connect(ble_my_service_t *p_my_service, ble_evt_t const *p_ble_evt)
{
    p_my_service->conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
}

Immediately after I hit connect on the phone, the program is unresponsive and does not output any other messages to the terminal that it usually does. I'm not calling any characteristic update functions.

If I comment out ble_my_service_on_connect(), the program works fine. This would imply that my_service_init() is working fine.

Any ideas?

SDK14.0 nrf52832 sd132

Parents Reply Children
No Data
Related