void mac_scan_descr_clear() { mem_ptr_t *mem_ptr; for (mem_ptr = list_chop(scan_list); mem_ptr != NULL; mem_ptr = list_chop(scan_list)) { mac_scan_descr_free(mem_ptr); } }
/* * This function indicates that a beacon frame has arrived. We will then need to * parse the contents and add it to the pan descriptor. If the protocol ID * is incorrect, then we trash the descriptor by removing it from the list and * freeing it. */ void mac_beacon_notify_ind(buffer_t *buf, mem_ptr_t *mem_ptr) { /* parse the beacon contents and add it to the descriptor */ nwk_parse_beacon(buf, mem_ptr); /* * if the protocol id is not for zigbee, then remove the * descr from the scan list and free the block of memory. */ if (SCAN_ENTRY(mem_ptr)->prot_id != ZIGBEE_PROTOCOL_ID) mac_scan_descr_free(mem_ptr); }