-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(HCI): Support the TX Test V4 command #73
base: main
Are you sure you want to change the base?
Conversation
src/max_ble_hci/ble_standard_cmds.py
Outdated
def tx_test( | ||
self, | ||
mode: Union[TxTestMode, int] = TxTestMode.ENHANCED, | ||
channel: int = 0, | ||
phy: Union[PhyOption, int] = PhyOption.PHY_1M, | ||
payload: Union[PayloadOption, int] = PayloadOption.PLD_PRBS9, | ||
packet_len: int = 0, | ||
cte_len: int = 0, | ||
cte_type: Union[CteType, int] = CteType.AOA, | ||
switch_pattern_len: Union[SwitchPatternLen, str] = SwitchPatternLen.MIN, | ||
switch_pattern: int = 0, | ||
power: Union[TxPower, str] = TxPower.MAX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the V4 test command yields the following results from the device's console:
### LlApi ### LlTxTest, rfChan=0, len=0, pktType=0
Parameter out of absolute range: txPower=48
Note that txPower
is 48, instead of the max TX power level (decimal 127 , hex 0x7F). This is because the switch_pattern_len
is defaulting to 2 and the switch_pattern
defaults to using only one antenna ID --- causing the pbuf
in firmware to not parse the power field correctly.
Modifying switch_pattern_len
to be 1 to more accurately reflect our pattern yields the proper power level and a SUCCESS status code. However, this would be conflicting with Packetcraft's HCI_CTE_SWITCHING_PATTERN_MIN_LEN
macros (value of 2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EricB-ADI Why would Packetcraft support a minimum switch pattern length of 2? I am wondering how this works for the ME17 EV Kit, which only has one antenna exposed.
Should I change the minimum value to 1 both here and on Packetcraft?
Or should I simply default to 1 here, and forget about supporting the SwitchPatternLen
values? I recall our discussion of not wanting to completely support the TX test V4 just yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch pattern is for angle of arrival. So, you would need at least 2 antennas or else it would be pretty much useless. Not sure why zero is not a default since AoA is not required. But 1 does not make sense for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why zero is not a default since AoA is not required.
Ah, that clarifies things for me. In that case, I will
- default the switch pattern length to 0, and
- remove the switch pattern argument entirely
…uments. More Docstrings to satisfy pylint
src/max_ble_hci/ble_standard_cmds.py
Outdated
elif mode == TxTestMode.V4.value: | ||
# Angle of Arrival (AOA) is not needed, so no switch pattern will be provided | ||
switch_pattern_len = 0 | ||
params = [ | ||
channel, | ||
packet_len, | ||
payload, | ||
phy, | ||
cte_len, | ||
cte_type, | ||
switch_pattern_len, | ||
power | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up removing the switch pattern length from the function as well, and instead override its value to zero. Thinking that there's little point in supporting the length while not supporting the pattern.
However, if you wish to support them both, perhaps we can format the pattern argument as a string and append it to the params
list.
For example: tx-test --mode 4 --pattern "0,1"
where 0 and 1 are antenna IDs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in the future, but for now, since we don't have any AoA stuff set up, we can ignore it.
Description
Extend the
tx_test()
function to support the V4 test.To use, use the following command in the HCI tool:
tx-test -m 4
ortx-test --mode 4