Skip to content

Add nav pins: per-device sensor pin settings - #5

Open
ShivtejG236 wants to merge 1 commit into
mainfrom
feat/device-pins
Open

ShivtejG236 wants to merge 1 commit into
mainfrom
feat/device-pins

Conversation

@ShivtejG236

Copy link
Copy Markdown
Member

Host side of firmware PR multi-sensor-navigation-system/firmware#7.

What

  • nav pins / nav pins show: the connected board's unique id and the GPIOs in use.
  • nav pins set [--sda N] [--scl N] [--gps-rx N] [--gps-tx N]: store new pins on that board. Signals not given keep their pin.
  • nav pins reset: back to the board defaults. nav pins restore: put the saved pins back after a flash erase.
  • navkit.wire: frame encoder, SET_PINS / RESET_PINS, ACK decoding.
  • navkit.device: the conversation with the board (retry on a lost command, wait for the HELLO after the restart) and the per-device profiles in <workspace>/devices/<id>.json.

Checks on a pin choice

  1. navkit checks it against the board's pin_rules from the firmware release manifest and prints every reason.
  2. The firmware checks it again and stores nothing it rejects. If the rules cannot be fetched (offline, or no release yet), this check alone decides and its refusal is shown.

The device id comes from the board, so it is validated as 12 hex digits before it is used in a file name.

Compatibility

Works only with firmware that has pin settings; older firmware gets a message to update. Logging and the rest of the pipeline are unchanged.

Tests

35 new tests (108 total). Command frames are compared byte for byte with the firmware encoder's output. The conversation is tested against a stand-in for the board, not real hardware.

navkit can now send the firmware's SET_PINS and RESET_PINS commands and read its ACK. Each board is identified by the unique id in its HELLO; its pins are stored on the device and a copy is kept in <workspace>/devices/<id>.json so they can be restored after a flash erase.

A pin choice is checked against the board's pin rules from the firmware release manifest before it is sent, and the reasons are shown. When the rules cannot be fetched the device's own check decides.
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.

1 participant