something-big-is-coming.jpg

4 posts / 0 new
Last post
rajshah
Offline
Last seen: 8 months 2 weeks ago
Joined: 2017-10-04 08:51
Device sacn

Dialog team,

My question is how we can scan ble device in pxp_reporter example code.
I am familiar with hrp_collector and and hrp_collector example. I know the "ble_gap_scan_start" API call and "handle_evt_gap_adv_report" handler. I tried this api in pcp_reporter but as soon as I call "ble_gap_scan_start" immediately "handle_evt_gap_adv_report" called.
So, kindly help me how we can scan ble devices in peripheral (pxp_reporter example) code?

Thanks
Raj

Keywords: 
Device: 
PM_Dialog
Offline
Last seen: 25 min 49 sec ago
Staff
Joined: 2018-02-08 11:03
Hi rajshah,

Hi rajshah,

I would strongly recommend you to have a look at the ble_central example of the SDK. The ble_central project is found in folder <sdk_root_directory>/projects/dk_apps/ble_central. Also, it would be very helpful to read the section 7.11.3 of the UM-B-044 User Manual: DA1468x Software Platform Reference (HTML) user manual. You should follow this example and then you will have to include the same implementation in you project.

Thanks, PM_Dialog

rajshah
Offline
Last seen: 8 months 2 weeks ago
Joined: 2017-10-04 08:51
Hi PM_Dialog

Hi PM_Dialog

Thanks for the response.

I looked into the ble_central example and UM-B-044 document as you suggested and tried to implement in pxp_reporter example code and I got following results:

1. When application start with,
ble_central_start();
ble_register_app();

Result: Device can scan nearby BLE devices but device not advertising.

2. When application start with,
ble_peripheral_start();
ble_register_app();

Result: Device can't scan nearby BLE device but it can advertising.

3. When application start with,
ble_enable();
ble_gap_role_set(GAP_CENTRAL_ROLE | GAP_PERIPHERAL_ROLE);
ble_register_app();

OR
ble_peripheral_start();
ble_central_start();
ble_register_app();

Result: Device can't scan nearby BLE device but it can advertising.

Below is code to start scanning process:

ble_gap_scan_start(GAP_SCAN_ACTIVE, GAP_SCAN_OBSERVER_MODE,
BLE_SCAN_INTERVAL_FROM_MS(500),
BLE_SCAN_WINDOW_FROM_MS(500),
false, false);

If any ble device scanned then "BLE_EVT_GAP_ADV_REPORT" handler called.

I go through entire "UM-B-044 User Manual: DA1468x Software Platform Reference (HTML) user manual" document but didn't found adverting and scanning both are working in one example code.

I also looked into the "ble_multi_link" example code but it also not working. Could you please provide me code snippets or example code for device advertising in connectable mode and scan nearby BLE device advertising data (device name and RSSI) together?

Thanks
Raj

PM_Dialog
Offline
Last seen: 25 min 49 sec ago
Staff
Joined: 2018-02-08 11:03
Hi rajshah,

Hi rajshah,

Could you please clarify your question? Do you want to act both as central and as peripheral ta the same time? If you mean that, you are not able to do this implementation. Or do you want to implement role switching like the ble_multi_link example of the SDK?

Thanks, PM_Dialog