2 months, 3 weeks ago.

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

This is my code, 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 months, 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, any idea or improvement are very welcome!


- 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 and change your code accordingly.

Please let me know if you have any questions.

posted by Desmond Chen 03 Jan 2019

I noticed that mbed os v5.11.2 was released and I found that #9220 was included in this release, but after "update all" of my source code, , I found that the PHY status was still 1M but the actual one is 2M PHY. I'm wonderting that is 5.11.2 pulled by developer now?

posted by Kai Ren 22 Jan 2019

You need to select mbed-os.lib, and click "update". There is a "revision" tab on the top, you can check if your mbed-os.lib is 5.11.2.

posted by Desmond Chen 22 Jan 2019

To post an answer, please log in.