Repository navigation
Validate session AppConfig parameters at start - #155
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive session start configuration validation, refactoring MAC address size handling, and updating the SessionStatusNtf packet to use the ReasonCode enum instead of raw integers. Key changes include adding an invalid_start_reason check to validate MAC address mode, destination MAC address list length, number of controlees, and ranging duration, alongside adding integration tests for these validations. The review feedback suggests several improvements to the validation logic: explicitly requiring a non-empty DstMacAddress for non-DL-TDoA FiRa sessions to prevent silent ranging failures, validating that the number of controlees is within bounds (1 to MAX_NUMBER_OF_CONTROLEES), and ensuring that slots_per_rr, slot_duration, and ranging_duration are non-zero to avoid potential division-by-zero errors or invalid configurations.
31ce5c1 to
9226b50
Compare
9226b50 to
ba4dfd3
Compare
dd05066 to
f26c1d2
Compare
While PR #144 added start-time DL-TDoA active-rounds validation, separate SessionSetAppConfigCmd calls can leave AppConfig internally inconsistent across MAC address mode, controlee count, and ranging duration, while SessionStatusNtf.reason_code remained an untyped u8. Type SessionStatusNtf.reason_code as ReasonCode in PDL and uci.py with 0x40 and 0x41 promoted out of RFU_REASON_CODE_RANGE_2, and extend Session::invalid_start_reason to validate MAC address widths, controlee counts, unicast mode, and FiRa slot budget at session_start. Closes #125
f26c1d2 to
275c154
Compare
While PR #144 added start-time DL-TDoA active-rounds validation, separate SessionSetAppConfigCmd calls can leave AppConfig internally inconsistent across MAC address mode, controlee count, and ranging duration, while SessionStatusNtf.reason_code remained an untyped u8.
Type SessionStatusNtf.reason_code as ReasonCode in PDL and uci.py with 0x40 and 0x41 promoted out of RFU_REASON_CODE_RANGE_2, and extend Session::invalid_start_reason to validate MAC address widths, controlee counts, unicast mode, and FiRa slot budget at session_start.
Closes #125