Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

crsz20
Copy link
Collaborator

@crsz20 crsz20 commented Jan 27, 2025

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 or tx-test --mode 4

Comment on lines 588 to 599
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,
Copy link
Collaborator Author

@crsz20 crsz20 Jan 27, 2025

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).

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Collaborator Author

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

Comment on lines 653 to 665
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
]
Copy link
Collaborator Author

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

Copy link
Member

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.

@crsz20 crsz20 requested a review from EricB-ADI January 29, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants