Erhannis
Erhannis

Reputation: 4464

LE Coded PHY on Android

LE Coded PHY (Bluetooth 5 long range) is pretty new, and information on it is scarce. My primary question: how do you use it? Suppose you have an Android phone emitting a BT signal, and another Android phone receiving. Assume that both sides CAN use LE Coded PHY - how do you ensure they are using it? My default tentative assumption is that, lacking documentation claiming otherwise, it switches modes when signal strength gets too low. However, I'm not at all sure of that. Indeed, there's a little evidence that it must be triggered manually: "Set the primary PHY to a LE Coded PHY (GAP_ADV_PRIM_PHY_CODED_S2 or GAP_ADV_PRIM_PHY_CODED_S8) in the advertisement parameters." (from the link above.) However, I have been unable to find any mention of how to do that from Android.

Now, note that using Android on both ends is just a test - we have a peripheral that is supposed to support LE Coded PHY, but range seems unaffected whether we connect it to a phone with LE Coded PHY support or without. We want to set up a test where we know Coded is being used, so we can compare the performance of other devices. Are there flags that need to be set? Modes to be switched? Jigs to be danced, hijinks to be enacted?

Upvotes: 3

Views: 4175

Answers (1)

Youssif Saeed
Youssif Saeed

Reputation: 13305

You are right, CODED PHY is relatively new and information on it is scarce. According to the Bluetooth spec, there are three main modes of CODED PHY:-

  • CODED PHY advertisements/scanning: this is when advertising/broadcasting and scanning/observing is performed on CODED PHY 1.
  • CODED PHY Connection Initiation: This is when a device is advertising over CODED PHY, and then a remote device connects to it over the CODED PHY modulation [2].
  • CODED PHY Connection Switch: This is when you are already in a connection and then you request to switch to CODED PHY. If the remote device accepts the request, then the connection changes to CODED PHY and all packet exchanges are performed over that modulation [3].

Now that is not to say you can not tweak that. You can write an Android app that requests a switch to CODED PHY (third method) when the RSSI is low,or you can modify your application so thata it only scans for adverts over CODED PHY if it can't find anything over normal 1MPHY, etc.

If you want to see this in play, I recommend checking the nRF Connect app on Android and a phone that supports the CODED PHY features (e.g. One Plus 7, Galaxy S10, etc). You'll notice that once you're in a connection, you can manually switch to CODED PHY or 2MPHY from the connection settings. You can find out if your phone supports the CODED PHY feature by checking the "Device Information" from the menu.

For further reading, I recommend checking the following:-

References

  1. Bluetooth Specificaiton Version 5.1, Vol 1, Part A, Section 3.3.2.2.2
  2. Bluetooth Specification Version 5.1, Vol 6, Part B, Section 4.4.4.2
  3. Bluetooth Specification Version 5.1, Vol 2, Part E, Section 7.8.49

I hope this helps.

Upvotes: 5

Related Questions