Skip to content

Validate session AppConfig parameters at start - #155

Merged
sameer merged 1 commit into
mainfrom
app-config-validation
Oct 29, 2026
Merged

sameer merged 1 commit into
mainfrom
app-config-validation

Conversation

@sameer

@sameer sameer commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/app_config.rs
Comment thread src/app_config.rs Outdated
Comment thread src/app_config.rs
@sameer
sameer force-pushed the app-config-validation branch 2 times, most recently from 31ce5c1 to 9226b50 Compare October 28, 2026 22:31
@sameer
sameer changed the base branch from dl-tdoa to fira2-caps October 28, 2026 22:32
@sameer
sameer added this pull request to stack #145 October 28, 2026 22:32
@sameer
sameer force-pushed the app-config-validation branch from 9226b50 to ba4dfd3 Compare October 28, 2026 23:45
@sameer
sameer force-pushed the app-config-validation branch 4 times, most recently from dd05066 to f26c1d2 Compare October 29, 2026 01:36
Base automatically changed from fira2-caps to main October 29, 2026 02:22
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
@sameer
sameer force-pushed the app-config-validation branch from f26c1d2 to 275c154 Compare October 29, 2026 02:22
@sameer
sameer merged commit 22cfebb into main Oct 29, 2026
13 checks passed
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.

Validate app config consistency after set

2 participants