Breaking change: DATA_CMD_GET_DEVICE_MODEL to match chameleon_device_type_t

cf https://github.com/RfidResearchGroup/ChameleonUltra/pull/147#pullrequestreview-1637478473
This commit is contained in:
Philippe Teuwen
2023-09-24 01:27:48 +02:00
parent f7db6d0fb3
commit 867ee7bf9b
3 changed files with 4 additions and 8 deletions
+1 -1
View File
@@ -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
+1 -5
View File
@@ -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);
}
+2 -2
View File
@@ -244,7 +244,7 @@ class HWConnect(BaseCLIUnit):
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:
@@ -306,7 +306,7 @@ class HWVersion(DeviceRequiredUnit):
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})')