5 years, 8 months ago.

BLE_SM example Issues

Hi All, I was trying out the BLE_SM example from mbed-os-example-ble repo but i am facing few issues(I am using Mbed supported Device (CY8C_PROTO_4343W) and one 3rd party device to connect to it).

1. After the pairing is successful on checking the pairing information exchanged i am seeing on my 3rd party device that Identity Resolution key (IRK) for my Mbed device is shown as 0 i.e all 128 bits are 0 as a result of this if i disconnect and pair again the address resolution fails and another set of bond data is created for this connection. I am attaching the console output from the application. Any help will be appreciated.

/media/uploads/AmalMishra/ble_sm.png

2. The readme of the example states that the device will first start as the central scanning for any device present in the vicinity and will try to connect, on successful pairing it will disconnect and start advertising for connections to depict peripheral functionality. In reality the application does the opposite of it. Please update the readme accordingly.

Thanks

Question relating to:

Bluetooth Low Energy (a.k.a Bluetooth LE, BTLE, Bluetooth Smart)

1 Answer

5 years, 8 months ago.

Hi Amal,

This issue is addressed here https://github.com/ARMmbed/mbed-os/issues/10195, you can track the issue there.

Thanks,

Desmond, team Mbed

Hi Desmond Thanks for the answer. Is the issue of Identity Resolution Key (IRK) of Mbed device being shown as 0 on my 3rd party device due to the same reason?

posted by Amal Mishra 22 Mar 2019

It seems not related, do you have sniffer to record the pairing procedure and see if it's correct?

posted by Desmond Chen 22 Mar 2019

Yes i do have a sniffer. will try out. meanwhile since i was getting pairing result as success i assumed the pairing process was going well. My doubt was on key generation part. I am not able to find out how the key generation is happening . That information could help me out. Since my device is using cordio stack. does the stack generates key by itself or is taking it from the controller? Also my device supports Bluetooth 4.1.

posted by Amal Mishra 22 Mar 2019

Hi Desmond, I was doing some digging and came across this function in CordioPalGap

Cordio API

bool Gap::is_privacy_supported()
{
    // We only support controller-based privacy, so return whether the controller supports it
    return HciLlPrivacySupported();
}

Does that mean for devices supporting Bluetooth 4.1 privacy is not supported as they deploy host based privacy only?

posted by Amal Mishra 26 Mar 2019

This means local stack only supports controller-based privacy, but it doesn't affect the privacy behavior with peer device.

posted by Desmond Chen 26 Mar 2019

Hi Desmond thanks for the answer. On set_irk api, do you guys have a key generation function which can be used to generate keys which can be passed to the set_irk?

posted by Amal Mishra 27 Mar 2019

Hi Amal,

Quote:

Does that mean for devices supporting Bluetooth 4.1 privacy is not supported as they deploy host based privacy only?

I guess I didn't answer correctly to your last comment due to misunderstanding it. Yes, currently with Cordio in Mbed OS, only controller-based privacy is supported, we are prioritise this requirement.

You can use get_random_data to generate the key.

https://github.com/ARMmbed/mbed-os/blob/f87a3e9c3272213f91ad84ef8e417a771794d4d8/features/FEATURE_BLE/ble/pal/PalSecurityManager.h#L1070

posted by Desmond Chen 28 Mar 2019