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

How can I make the central device like smartphone connect the nRF52832 acted as peripheral automatically?

       Dear,

       After adding the peer manager module of the SDK 15.2 and some other codes about configuring static passkey in the example "ble_app_uart" in ble_peripheral, I can successfully realize the static passkey and storing bonding infromation features.

       But the goal of my design is that the central device, just like a smartphone which is paired and bonded successfully at the first time, can automatically connect the nRF52832 acted as the peripheral device without needing someone to manually do connecting operations when the nRF52832  began to advertise just like the example "ble_app_hids_keyboard".

      In the example "ble_app_hids_keyboard",  I find that after one central device, just like a smartphone, has bonded with the nRF52832, the central device will connect the nRF52832  automatically without needing someone to do any operations once finding the nRF52832 begin to advertise.

      I also hope my project owning the same features, and I have already tried many times to modified the  example "ble_app_uart" but failed. I consider the really reason is that  I do not know the specific ,clear and detailed steps of how to organize codes to realize the functionality which the bonded central device can automatically connect the nRF52832 once nRF52832 begin to advertise.

     I will look forward your useful guidances to help me realize my design goals.

   Thanks very much for your help.

  Best regards,

  Tianfei

Parents
  • Hi,

    If you are making a central that should reconnect to a known device automatically, you should start scanning again and check the scan reports against the known device list. I would recommend that you take a look at our tutorials section here for more details on how to make a central device.

  • Hi,

          There is some mistakes in my expression as a foreign people using English to.describe questions.

           In the example "ble_app_hids_keyboard" based nRF5_SDK_15.2.0_9412b96, I found my smartphone can automatically connect nRF52832 after bonded without needing someone to do connecting operation. 

           I also hope my project owing the same feature that everytime my smartphone can connect the nRF52832 automatically without needing me to do connecting operation after bonded. But I do not know how to modify the code in order to realize this function.

           The main use of nRF52832 for my project is to  transmit data. So I modify the code of example "ble_app_uart" based nRF5_SDK_15.2.0_9412b96 to realize all the features which my project need.

            Finally, I wish you can give me some guidance to help me achieve the feature.

           Thanks very much for your help.

            Best regards.

           Tianfei

  • Smartphones will connect automatically to devices that has a service that is natively supported by the OS. typically HID for Android and iOS, and also ANCS for iOS. An alternative would be to have a background mode in your application where the application will scan for your device even if it is not in the foreground.

Reply Children
No Data
Related