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

[nRF51822] Connectable Indirected advertising after pairing was done.

Hi sir In Desktop 2, before BTLE pairing, nRF51 uses Connectable Indirected advertising. After BTLE pairing with BTLE host, nRF51 will select Directed advertsing for saving connection time. Could nRF51use Connection Indirected advertising type to the BTLE host which was already paired with it? Then, like mouse or keyboard device, can they still work well?

Regards, Jeffery

  • Connecting with Master Emulator will not make the device appear as a regular HID device, so you will not be able to control anything with it. If wanted, I guess you could in principle parse the data in the application to know whether it makes sense or not, or else you'll have to just assume that everything is good if you actually get data.

    Doing tricks to make multiple devices appear as the same device to Windows is not easy to solve, and I'm not sure I'd recommend trying that. Remember that you'd also have to make sure that all devices have the same encryption key for this to work; it is not sufficient that they have the same address. This would therefore require modifications to your program.

    Most customers seems to be using the Master Emulator to do production testing.

  • So, you mentioned besides the same device address, I also need same ecryption key. For Desktop 2, where did you set encryption key? Could we read it out? It is a random number? Would it also be stored in flash after bonding done? Thanks.

  • The encryption keys are handled by the bond manager, and written to flash once a bond has been successfully established. You should therefore look at the ble_bondmngr.c file to see how it's stored. Encryption keys are generated when a bond is first established, and then reused on all subsequent connections.

    What you want to do is not trivial, and as I said, I'd normally not recommend anyone going down this path.

  • In Desktop 2 source code, Bonding information was stored at flash page 255 and System attribute was stored at flash page 253. Then, I made a experiment. Step1. Pair nRF51822 sample A with BTLE host. Step2. Copy flash page 253 and 255 from sample A to smple B. Step3. Modify sample B to have same device address as sample A. Step4. Try sample B to connect the BTLE host directly without pairing. (The BTLE host already had bonding record of sample A)

    The result is frustrating. Sample B still cannot work with BTLE host.
    
  • Dear Ole Morten I had copied all the flash data to another sample as I mentioned in last message. It still cannot work. Please comment it. Thanks.

Related