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

Connection between NRF51 and Android smartphone

Hello I want to establish the connection between nrf51822(base station) and:

  • the second nrf51822(transceiver)
  • android smartphone(transceiver) It has to be possible without reflashing the base station. It uses NUS service. Base station is central node and the transceiver is peripheral. Actually I managed to do the first part (connection between 2x nrf51822. I read the Bluetooth MAC from the transceiver and save it in the base station. The base station looks for advertising devices and checks their MACs. But I have a problem with the second situation(smartphone with android). The MAC address changes periodically. I read that it is a private address and I have to use IRK to decrypt the original MAC address. But I don't know how to do this because at the same time it has to be possible to connect to the nrf51822 with static MAC address and to smartphone. I hope You will help me to solve this problem. Greetings
Parents
  • Thank You for reply. I will use peer manager as You recommend. But I don't understand how it should work. It has to work both with smartphone and NRF51 module. And how can I initiate pairing and bonding on NRF51 device which doesn't have any buttons. Maybe could You tell me more about Peer Manager.

  • FormerMember
    0 FormerMember in reply to jb1

    To make your device initiate bonding, you can for example set up your device to initiate bonding immediately after a connection has been established, upon the event BLE_GAP_EVT_CONNECTED. For how to initiate bonding from the peripheral, I would recommend you to take a look at this message sequence chart.

    The example ble_app_gls in the SDK does for instance use peer manager to handle bonding.

    This video tutorial, part 2 (code walkthrough), gives you an introduction to peer manager.

Reply
  • FormerMember
    0 FormerMember in reply to jb1

    To make your device initiate bonding, you can for example set up your device to initiate bonding immediately after a connection has been established, upon the event BLE_GAP_EVT_CONNECTED. For how to initiate bonding from the peripheral, I would recommend you to take a look at this message sequence chart.

    The example ble_app_gls in the SDK does for instance use peer manager to handle bonding.

    This video tutorial, part 2 (code walkthrough), gives you an introduction to peer manager.

Children
No Data
Related