Skip to content

Commit

Permalink
Fix GET_DEVICE crash
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Aug 28, 2023
1 parent d22ff44 commit 4272d76
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions firmware/application/src/app_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ data_frame_tx_t *cmd_processor_get_git_version(uint16_t cmd, uint16_t status, ui
return data_frame_make(cmd, status, strlen(GIT_VERSION), (uint8_t *)GIT_VERSION);
}


data_frame_tx_t *cmd_processor_get_device(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) {
#if defined(PROJECT_CHAMELEON_ULTRA)
return data_frame_make(cmd, status, 1, (uint8_t *)1);
uint8_t device = 1;
#else
return data_frame_make(cmd, status, 1, (uint8_t *)0);
uint8_t device = 0;
#endif
return data_frame_make(cmd, status, 1, &device);
}


Expand Down Expand Up @@ -763,11 +765,11 @@ data_frame_tx_t *cmd_processor_get_enabled_slots(uint16_t cmd, uint16_t status,

data_frame_tx_t *cmd_processor_get_ble_connect_key(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) {
return data_frame_make(
cmd,
STATUS_DEVICE_SUCCESS,
BLE_CONNECT_KEY_LEN_MAX, // 6
settings_get_ble_connect_key() // Get key point from config
);
cmd,
STATUS_DEVICE_SUCCESS,
BLE_CONNECT_KEY_LEN_MAX, // 6
settings_get_ble_connect_key() // Get key point from config
);
}

data_frame_tx_t *cmd_processor_set_ble_connect_key(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) {
Expand Down

0 comments on commit 4272d76

Please sign in to comment.