BT Scan callbacks in Smartbridge API

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiTo_1583836
Level 5
Level 5
50 likes received 25 likes received 10 likes received

I am using SDK 3.4.0 and writing an application that uses the Smartbridge API. Looking at the details of the API in smartbridge_stack_if.c/h I do NOT see a way to register the callbacks to app_scan_complete_callback and app_scan_report_callback.

I do see the callback app_scan_complete_callback being called in: static void smartbridge_scan_result_callback( wiced_bt_ble_scan_results_t *p_scan_result, uint8_t *p_adv_data ) at the end of the scan, but no API to set the callback.

I added the following registration function in smartbridge_stack_if.c so I can register a callback from the main application in order to get the notification when the scanning is completed after scan_settings.duration_second. I will do the same for the scan report callback so I can get access to the report at the application level as well.

//Extra function for callback

void smartbridge_bt_interface_register_scan_complete_callback(wiced_bt_smart_scan_complete_callback_t  ptr_app_scan_complete_callback)

{

  WPRINT_LIB_INFO(( "[SmartBridge] smartbridge_bt_interface_register_scan_complete_callback - 0x%04x\n",  ptr_app_scan_complete_callback));

  app_scan_complete_callback = ptr_app_scan_complete_callback;

}

Please comment.

0 Likes
1 Reply
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

We are looking for someone internally that can respond to this request.

vik86gangi

0 Likes