Skip to content
Snippets Groups Projects
Commit bbeb6144 authored by Armin Luntzer's avatar Armin Luntzer
Browse files

if available, extract data crc from packet

parent a307da06
No related branches found
No related tags found
No related merge requests found
......@@ -560,6 +560,8 @@ struct rmap_pkt *rmap_pkt_from_buffer(uint8_t *buf)
(uint32_t) buf[RMAP_DATALEN_BYTE2 + n];
}
pkt->hdr_crc = buf[RMAP_HEADER_CRC];
if (pkt->data_len) {
pkt->data = (uint8_t *) malloc(pkt->data_len);
if (!pkt->data)
......@@ -567,6 +569,9 @@ struct rmap_pkt *rmap_pkt_from_buffer(uint8_t *buf)
for (i = 0; i < pkt->data_len; i++)
pkt->data[i] = buf[RMAP_DATA_START + n + i];
/* final byte is data crc */
pkt->data_crc = buf[RMAP_DATA_START + n + i];
}
......
......@@ -183,6 +183,8 @@ struct rmap_pkt {
uint32_t addr; /* (first) data address */
uint8_t *data;
uint32_t data_len; /* lenght of data in bytes */
uint8_t hdr_crc;
uint8_t data_crc;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment