Skip to content
Snippets Groups Projects
Commit 466e4fac authored by David Maul's avatar David Maul :crab:
Browse files

fix: fix bogus bytes at message end

parent b5e8ed7b
Branches
No related tags found
No related merge requests found
...@@ -84,11 +84,12 @@ static void prepare_for_sending(void) { ...@@ -84,11 +84,12 @@ static void prepare_for_sending(void) {
for (size_t a = 0; a < packet->data.count; a++) { for (size_t a = 0; a < packet->data.count; a++) {
uint8_t *bytes = (uint8_t *)&(packet->data.measurements[a]); uint8_t *bytes = (uint8_t *)&(packet->data.measurements[a]);
for (size_t b = 0; b < sizeof(measurement_t); b++) { // 10 bytes per measurement
for (size_t b = 0; b < 10; b++) {
secondary_send_buffer[n + b] = bytes[b]; secondary_send_buffer[n + b] = bytes[b];
} }
n += sizeof(measurement_t); n += 10;
} }
uint8_t *bytes = (uint8_t *)&packet->crc; uint8_t *bytes = (uint8_t *)&packet->crc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment