Skip to content

Commit

Permalink
Nimble ota(Request the sector again if crc mismtach)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrugglingBunny committed Dec 27, 2024
1 parent cec2b3b commit 15d0cb1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,15 @@ esp_ble_ota_write_chr(struct os_mbuf *om)

cmd_ack[0] = om->om_data[0];
cmd_ack[1] = om->om_data[1];
if (match)
if (match){
cmd_ack[2] = 0x00; // success
else
}else
{
cmd_ack[2] = 0x01; // crc error
// Request the sector again
cmd_ack[4] = cur_sector & 0xff;
cmd_ack[5] = (cur_sector & 0xff00) >> 8;
}
cmd_ack[3] = 0x00;
crc16 = crc16_ccitt(cmd_ack, 18);
cmd_ack[18] = crc16 & 0xff;
Expand Down

0 comments on commit 15d0cb1

Please sign in to comment.