Hello,
I am adapting the 802.15.4 wireless UART example from the nRF5 SDK 15.3 to also make scans and associate with a PAN coordinator. However i am having trouble with the mlme_scan_req(). When I call this function it never calls the callback function i provided and since the Library function is precompiled I cannot debug it. Here is the function that calls the mlme_scan_req():
static void a_passive_scan(void * p_data) { mp_scan_req = (mlme_scan_req_t *)sys_mm_alloc(sizeof(mlme_scan_req_t)); ASSERT(mp_scan_req != NULL); mp_scan_req->scan_type = PASSIVE_SCAN; mp_scan_req->scan_channels = 0x00000001<<14; mp_scan_req->scan_duration = 1; mp_scan_req->pan_descriptors_buf_size = 5; mp_scan_req->pan_descriptors_buf = (mac_pan_descriptor_t *)sys_mm_alloc(sizeof(mac_pan_descriptor_t)* mp_scan_req->pan_descriptors_buf_size); ASSERT(mp_scan_req->pan_descriptors_buf != NULL); mp_scan_req->energy_detect_buf_size = 5; mp_scan_req->energy_detect_buf = (uint8_t *)sys_mm_alloc(sizeof(uint8_t)*mp_scan_req->energy_detect_buf_size); ASSERT(mp_scan_req->energy_detect_buf != NULL); mlme_scan_req(mp_scan_req, mlme_scan_conf); }
Like I said the provided callback is never called. When I halt he programm with the debugger after callinf mlme_scan_req() it is in a loop in sys_queue_contains(). This is how the callstack looks like:
I have noticed that the struct mlme_scan_req_t which has to be provided to the mlme_scan_req() function is not according to the 802.15.4_2006 spezification. In the specification no pointer to the pan_descriptors_buf and energy_detect_buf have to be provided. Here is a relevant snippet of the specification:
I do not understand why these buffers need to be provided in the mlme_scan_req_t struct.
Any help with this would be highly appreciated.
Cheers, lorv