BLE Configuration to accept BLE pairing request

I have a broadcaster and a central device. The broadcaster beacons data every 60sec and goes to sleep, a configuration I have considered for minimal power consumption. Now in addition:

1- I want every 24 hours the broadcaster sends request for BLE pairing to the central device and pairs with it for a secure connection. 

2- I want the central device be able to send request for BLE pairing to the broadcaster and pairs with it casually upon a user request. This will be somehow interrupt driven, so that upon central device request, the broadcaster wakes up and pair with it. 

What configuration I should use and what is the impact of this configuration change on my broadcaster power consumption. 

Parents
  • Hi Kaveh, 

    There is no way a central can wake up a broadcaster without the broadcaster pro-actively wake up and advertise periodically. There is no "wake up on radio" option with BLE as this method require high sleep current. 

    So the way you can do this is to configure the broadcaster to sleep and wake up every say every 30 seconds to do advertising. If the central has receive a request from end user to connect to the broadcaster it can scan and connect to the broadcaster when it scan the advertising packet. The latency here will be maximum 30 seconds. You can reduce power consumption by reduce the rate of wake up rate. But that will increase the latency as well. 

    Please also note that if you do bonding, both peer devices will store a LTK (Long Term Key) and they can re-encrypt the link automatically. You don't need to do pairing on every connection. 

  • Thanks Hung. 

    So I will configure my end device as a broadcaster and the other device as central. The broadcaster can beacon every 15 sec. If there is a request from the user to send some data from central to broadcaster, the central will scan for that particular broadcaster and waits until it receives a beacon from the broadcaster. The next time the broadcaster beacons and that is received by the central, the central should request and BLE pair with broadcaster? Is it possible to pair with a broadcaster? 

  • Hi Kaveh, 

    Yes correct. 

    But I want to clarify the difference between "connect" and "pair": 

    - Connect: when the two device establish a direct communication , a connection. 

    - Pair: when the two devices encrypt the connection. Pairing only happens after the two device establish a connection, only after they "connect". You don't have to pair all the time when you connect to a device because you can "bond"

    - Bond: when the two device store the encryption key, so next time when they connect they don't have to do pairing. 


    So there is no problem pair with a broadcaster after you connect to the broadcaster /advertiser. 

  • Thanks Hung. 

    Is there sample codes in SDK for central device to scan for a broadcaster and connect to it? Is there sample code for broadcaster to connect to a central device upon such request? 

  • Hi Kaveh, 


    Yes, any example central/peripheral in the SDK would do that. 
    The only example that doesn't do connection is the beacon example. 
    I would suggest to test with the \examples\ble_peripheral\ble_app_blinky as the peripheral (Broadcaster) and \examples\ble_central\ble_app_blinky_c as the central. 

    Or you can test with  ble_app_uart and ble_app_uart_c.

Reply
  • Hi Kaveh, 


    Yes, any example central/peripheral in the SDK would do that. 
    The only example that doesn't do connection is the beacon example. 
    I would suggest to test with the \examples\ble_peripheral\ble_app_blinky as the peripheral (Broadcaster) and \examples\ble_central\ble_app_blinky_c as the central. 

    Or you can test with  ble_app_uart and ble_app_uart_c.

Children
Related