This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to make the ble_app_uart demo not advertising once power on?

Hi guys, I design one custom application based on the ble_app_uart demo and find the device is advertising when power on. I want to set it auto connect once the device has bonded. I add the dm APIs into this project and modify the adverting_init() and advertising_start(), which do as the hid keyboard project, but nothing change. It seems the bond info does not write to the flash correctly. could you guide me how to make it true ? with the flow better.

Thanks a lot.

Parents
  • Hi Jimlin, What do you mean by not advertising and "auto connect" ? A connection can only be made when the peripheral advertises and the central send connect request to start the connection. In the case of HID device, you can see that it got connected almost immediatelly after start up and appear to not advertise at all. But actually it does. It just get connected very fast right at the few first advertising packets so that you sometime couldn't scan and capture the advertising packet from other scanner. This behaviour was due to the fact that the HID is connected automatically by the phone OS without any app needed. In your case that you want to use ble_app_uart, you would need to have the app running and try to connect constantly.

Reply
  • Hi Jimlin, What do you mean by not advertising and "auto connect" ? A connection can only be made when the peripheral advertises and the central send connect request to start the connection. In the case of HID device, you can see that it got connected almost immediatelly after start up and appear to not advertise at all. But actually it does. It just get connected very fast right at the few first advertising packets so that you sometime couldn't scan and capture the advertising packet from other scanner. This behaviour was due to the fact that the HID is connected automatically by the phone OS without any app needed. In your case that you want to use ble_app_uart, you would need to have the app running and try to connect constantly.

Children
No Data
Related