Skip to content

Commit

Permalink
fix(ble_ota): Fixed ble ota packet index issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xiewenxiang committed Jan 2, 2024
1 parent 2d256ef commit 1e03263
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion components/bluetooth/ble_profiles/esp/ble_ota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@

## v0.1.10 - 2023-11-23

* Fix possible cmake_utilities dependency issue
* Fix possible cmake_utilities dependency issue

## v0.1.11 - 2024-01-02

* BLE-OTA:
* Fixed ble ota packet index issue.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.1.10"
version: "0.1.11"
targets:
- esp32
- esp32c3
Expand Down
6 changes: 3 additions & 3 deletions components/bluetooth/ble_profiles/esp/ble_ota/src/ble_ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ void esp_ble_ota_send_ack_data(ble_ota_ack_type_t ack_type, uint16_t ack_status,
switch (ack_type) {
case BLE_OTA_CMD_ACK:
cmd_ack[0] = (BLE_OTA_ACK_CMD & 0xff);
cmd_ack[1] = (BLE_OTA_ACK_CMD & 0xff) >> 8;
cmd_ack[1] = (BLE_OTA_ACK_CMD & 0xff00) >> 8;

cmd_ack[2] = (ack_param & 0xff);
cmd_ack[3] = (ack_param & 0xff00) >> 8;
Expand All @@ -646,13 +646,13 @@ void esp_ble_ota_send_ack_data(ble_ota_ack_type_t ack_type, uint16_t ack_status,
break;
case BLE_OTA_FW_ACK:
cmd_ack[0] = (ack_param & 0xff);
cmd_ack[1] = (ack_param & 0xff) >> 8;
cmd_ack[1] = (ack_param & 0xff00) >> 8;

cmd_ack[2] = (ack_status & 0xff);
cmd_ack[3] = (ack_status & 0xff00) >> 8;

cmd_ack[4] = (cur_sector & 0xff);
cmd_ack[5] = (cur_sector & 0xff) >> 8;
cmd_ack[5] = (cur_sector & 0xff00) >> 8;

crc16 = crc16_ccitt(cmd_ack, 18);
cmd_ack[18] = crc16 & 0xff;
Expand Down
2 changes: 1 addition & 1 deletion examples/bluetooth/ble_ota/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ dependencies:
espressif/esp_encrypted_img: "^2.0.1"
idf: ">=4.4"
ble_ota:
version: "~0.1.8"
version: "~0.1.11"
override_path: "../../../../components/bluetooth/ble_profiles/esp/ble_ota"

0 comments on commit 1e03263

Please sign in to comment.