Skip to content

Commit

Permalink
Fix data format typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Oct 16, 2024
1 parent c3e63f3 commit 6982b6f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/devices/rosstech_dcu706.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ static int rosstech_dcu706_decode(r_device *decoder, bitbuffer_t *bitbuffer)
uint8_t msg_type = (msg[0] << 1) | (msg[1] >> 7); // S
uint8_t id_high = (msg[1] << 4) | (msg[2] >> 4);
uint8_t id_low = (msg[2] << 7) | (msg[3] >> 1);
uint16_t id = (id_high << 8) | id_low; // I
uint8_t temp_f = (msg[4] << 2) | (msg[5] >> 6); // T
uint8_t checksum = (msg[5] << 5) | (msg[6] >> 3); // C
uint16_t id = (id_high << 8) | id_low; // I
uint8_t temp_f = (msg[4] << 2) | (msg[5] >> 6); // T
uint8_t checksum = (msg[5] << 5) | (msg[6] >> 3); // C

// Create a uint8_t array to hold the extracted values
uint8_t extracted_data[4];
Expand All @@ -108,9 +108,9 @@ static int rosstech_dcu706_decode(r_device *decoder, bitbuffer_t *bitbuffer)
/* clang-format off */
data_t *data = data_make(
"model", "Model", DATA_STRING, "Rosstech-Spa",
"id", "ID", DATA_FORMAT, "%04x", DATA_INT, id,
"id", "ID", DATA_FORMAT, "%04x", DATA_INT, id,
"msg_type", "Transmission Type", DATA_STRING, msg_type == 0xba ? "Data" : "Bond",
"temperature_F", "Temperature", DATA_FORMAT, "%d °C", DATA_INT, temp_f,
"temperature_F", "Temperature", DATA_FORMAT, "%d F", DATA_INT, temp_f,
"mic", "Integrity", DATA_STRING, "CHECKSUM",
NULL);
/* clang-format on */
Expand Down

0 comments on commit 6982b6f

Please sign in to comment.