Central - scanning for devices

Learn MoreFAQsTutorials

10 posts / 0 new
Last post
adam.stroz
Offline
Last seen:4 days 4 hours ago
Joined:2020-05-22 07:54
Central - scanning for devices

Hello,

I have a small questions, I configure my device as central (currently i'm using "da14531_ble_central_implementation" example). My question is, why Da14531 do not recognize android phone? Is android a BLE central or peripheral device? And second questions. When my device operate as peripheral, can i start connection with central?

Device:
PM_Dialog
Offline
Last seen:44 min 57 sec ago
Staff
Joined:2018-02-08 11:03
Hi adam.stroz,

Hi adam.stroz,

The BLE generic mobile applications are usually configured as GAP Central, so the mobile phone will start the scanning procedure and connected to the peer device. According to BLE specs, the connection is always initiated by the GAP Central. If the DA4531 is configured as GAP centrals, then you should know the BD address of the peripheral, so that you can send the connection request. To do so, you should know the BD address of the mobile phone. Keep in mind that most of the mobile phone are using random BD address, so every time you should know the new BD address.

如果DA14531配置外围的差距,你can use any BLE generic mobile application, scan for the available BLE device and initiate the connection.

I would recommend first checking theBLE Advertising Tutorial (HTML)andGetting Started with SDK6 (HTML)tutorials.

Thanks, PM_Dialog

adam.stroz
Offline
Last seen:4 days 4 hours ago
Joined:2020-05-22 07:54
Hello,

Hello,

So summarizing the above, my phone is probably GAP Central and I must configure my device as GAP peripheral to connect with him. My next question is about disconnecting. For example i have two devices (DA14531 as peripheral and Smartphone as central) and i connect smartphone to DA14531. I can disconnect using smartphone but can i disconnect using DA14531?

PM_Dialog
Offline
Last seen:44 min 57 sec ago
Staff
Joined:2018-02-08 11:03
Hi adam.stroz,

Hi adam.stroz,

You should disconnect it using the mobile phone. Please run any of the SDK BLE examples and test it with a BLE generic application to verify it.

Thanks, PM_Dialog

adam.stroz
Offline
Last seen:4 days 4 hours ago
Joined:2020-05-22 07:54

Maybe I'll clarify my question. Can I disconnect using some SDK function? (for example in my program, after connect to smartphone, i call function name "disconnect") It is possible? I don't want to disconnect using smartphone.

I describe my scenario. I want to connect to the device (Da14531 will be configured as peripheral, for example, my smartphone connects with him), next DA14531 start sending some information (this part work), disconnect and enter in the sleep state. After signal (GPIO wakeup) DA14531 wakes up and I want that my smartphone automatically connect to DA14531. It is possible?

PM_Dialog
Offline
Last seen:44 min 57 sec ago
Staff
Joined:2018-02-08 11:03
Hi adam.stroz,

Hi adam.stroz,

You could invoke the app_easy_gap_disconnect() API from the peripheral side, so that it will send the BLE disconnection command to the Central. To do so, after sending the information, then you should invoke that API.

Thanks, PM_Dialog

adam.stroz
Offline
Last seen:4 days 4 hours ago
Joined:2020-05-22 07:54
Thank you,

Thank you,

Can you give me a advice about my scenario?

PM_Dialog
Offline
Last seen:44 min 57 sec ago
Staff
Joined:2018-02-08 11:03
Hi adam.stroz,

Hi adam.stroz,

>>>my smartphone connects with him), next DA14531 start sending some information (this part work), disconnect and enter in the sleep state.

As mentioned in my previous comment, once the date have been sent to the Central, the SW should invoke the app_easy_gap_disconnect().

>>>After signal (GPIO wakeup) DA14531 wakes up

Please take a look at the ble_app_sleepmode example of the SDK. It used the WAKEUP controller to wake up via a GPIO trigger.

>>>I want that my smartphone automatically connect to DA14531.

This depends on the Central. According to BLE specs, the connection is always initiated by the Central.

Thanks, PM_Dialog

adam.stroz
Offline
Last seen:4 days 4 hours ago
Joined:2020-05-22 07:54
Ok, at this moment i know all

Ok, at this moment i know all. Thank you.

PM_Dialog
Offline
Last seen:44 min 57 sec ago
Staff
Joined:2018-02-08 11:03
Hi adam.stroz,

Hi adam.stroz,

If you have any other issue, please raise a new forum thread.

Thanks, PM_Dialog