CLI now takes into account Lite refusing to enter reader mode

This commit is contained in:
Philippe Teuwen
2023-08-28 01:07:27 +02:00
parent ae6df052f5
commit bd3961077c
3 changed files with 11 additions and 5 deletions
+1
View File
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Fixed CLI takes into account Lite refusing to enter Reader mode (@doegox)
- Security BLE implemented (@xianglin1998)
- Added `hw settings blekey` to get and set ble connect key (@xianglin1998)
- Added `hw ble bonds clear` to delete all ble bonds (@xianglin1998)
+8 -5
View File
@@ -36,20 +36,23 @@ data_frame_tx_t *cmd_processor_get_git_version(uint16_t cmd, uint16_t status, ui
data_frame_tx_t *cmd_processor_change_device_mode(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) {
#if defined(PROJECT_CHAMELEON_ULTRA)
if (length == 1) {
if (data[0] == 1) {
#if defined(PROJECT_CHAMELEON_ULTRA)
reader_mode_enter();
return data_frame_make(cmd, STATUS_DEVICE_SUCCESS, 0, NULL);
#else
return data_frame_make(cmd, STATUS_NOT_IMPLEMENTED, 0, NULL);
#endif
} else {
#if defined(PROJECT_CHAMELEON_ULTRA)
tag_mode_enter();
#endif
return data_frame_make(cmd, STATUS_DEVICE_SUCCESS, 0, NULL);
}
} else {
return data_frame_make(cmd, STATUS_PAR_ERR, 0, NULL);
}
return data_frame_make(cmd, STATUS_DEVICE_SUCCESS, 0, NULL);
#else
return data_frame_make(cmd, STATUS_NOT_IMPLEMENTED, 0, NULL);
#endif
}
data_frame_tx_t *cmd_processor_get_device_mode(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) {
+2
View File
@@ -317,6 +317,8 @@ class ChameleonCMD:
resp = self.device.send_cmd_sync(DATA_CMD_GET_DEVICE_MODE, 0x00)
return True if resp.data[0] == 1 else False
# Note: Will return NOT_IMPLEMENTED if one tries to set reader mode on Lite
@expect_response(chameleon_status.Device.STATUS_DEVICE_SUCCESS)
def set_reader_device_mode(self, reader_mode: bool = True):
"""
Change device mode, reader or tag