Skip to content

Commit

Permalink
Breaking change: DATA_CMD_GET_DEVICE_MODEL to match chameleon_device_…
Browse files Browse the repository at this point in the history
…type_t

cf #147 (review)
  • Loading branch information
doegox committed Sep 23, 2023
1 parent f7db6d0 commit 867ee7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ In the following list, "CLI" refers to one typical CLI command using the describ
* CLI: cf `hw ble bonds clear`
### 1033: GET_DEVICE_MODEL
* Command: no data
* Response: 1 byte. `hw_version` aka `NRF_DFU_HW_VERSION` (0=Ultra, 1=Lite)
* Response: 1 byte. `hw_version` aka `NRF_DFU_HW_VERSION` according to `chameleon_device_type_t` enum (0=Ultra, 1=Lite)
* CLI: cf `hw version`
### 1034: GET_DEVICE_SETTINGS
* Command: no data
Expand Down
6 changes: 1 addition & 5 deletions firmware/application/src/app_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ static data_frame_tx_t *cmd_processor_get_git_version(uint16_t cmd, uint16_t sta


static data_frame_tx_t *cmd_processor_get_device_model(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) {
#if defined(PROJECT_CHAMELEON_ULTRA)
uint8_t resp_data = 1;
#else
uint8_t resp_data = 0;
#endif
uint8_t resp_data = hw_get_device_type();
return data_frame_make(cmd, STATUS_DEVICE_SUCCESS, sizeof(resp_data), &resp_data);
}

Expand Down
4 changes: 2 additions & 2 deletions software/script/chameleon_cli_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def on_exec(self, args: argparse.Namespace):
self.device_com.open(args.port)
self.device_com.commands = self.cmd.get_device_capabilities()
major, minor = self.cmd.get_app_version()
model = 'Ultra' if self.cmd.get_device_model() else 'Lite'
model = ['Ultra', 'Lite'][self.cmd.get_device_model()]
print(f" {{ Chameleon {model} connected: v{major}.{minor} }}")

except Exception as e:
Expand Down Expand Up @@ -306,7 +306,7 @@ def on_exec(self, args: argparse.Namespace):
fw_version_tuple = self.cmd.get_app_version()
fw_version = f'v{fw_version_tuple[0]}.{fw_version_tuple[1]}'
git_version = self.cmd.get_git_version()
model = 'Ultra' if self.cmd.get_device_model() else 'Lite'
model = ['Ultra', 'Lite'][self.cmd.get_device_model()]
print(f' - Chameleon {model}, Version: {fw_version} ({git_version})')


Expand Down

0 comments on commit 867ee7b

Please sign in to comment.