Report
2 weeks, 5 days ago.

[BLE]nRF52DK update PHY to 2M PHY with iPhone 8, but the callback indicate it's still 1M PHY.

This is my code, https://os.mbed.com/users/krenbluetoothsig/code/BluetoothLEGap/ You can check the latest commit out, compile and run it on Nordic nRF52DK. I use my iPhone 8 (iOS 12.1) to connect with nRF52DK, I could noticed that iPhone and DK updated the PHY to 2M PHY because they were preferred PHY, but the callback from mbed OS indicated that the PHY is still 1M PHY, they are mismatched. The callback is below, the phy.value() is always 1.

virtual void onPhyUpdateComplete( ble_error_t error, Gap::Handle_t connectionHandle, Gap::Phy_t txPhy, Gap::Phy_t rxPhy ) { if (error) { printf( "Phy update on connection: %d failed with error code %s\r\n", connectionHandle, BLE::errorToString(error) ); } else { printf( "Phy update on connection %d - Tx Phy: %d, Rx Phy: %d\r\n", connectionHandle, txPhy.value(), /*to_string(txPhy),*/ rxPhy.value() /*to_string(rxPhy)*/ ); } }

Comment on this question

1 Answer

2 weeks ago.

Hi Kai Ren,

Thanks you for reporting this issue, it looks like the phy has been hard-coded, so no matter how you change the phy value, it is always LE_1M.

I have created a PR for this, you can refer to here https://github.com/ARMmbed/mbed-os/pull/9220, any idea or improvement are very welcome!

Thanks,

- Desmond, team Mbed

Thank you Desmond for creating this PR. I'm just curious that how can I implement this change on my application?

posted by Kai Ren 03 Jan 2019

Hi Kai Ren,

If you are using mbed online compiler, then you may not be able to fix this issue on your application, because this change stays in mbed-os.

The only way is to use mbed-cli offline compiler, that gives you more flexibility, with mbed-cli, you can refer here https://github.com/ARMmbed/mbed-os/pull/9220/files and change your code accordingly.

Please let me know if you have any questions.

posted by Desmond Chen 03 Jan 2019

To post an answer, please log in.