Skip to content

Commit

Permalink
Update neptune_r900.c
Browse files Browse the repository at this point in the history
added raw
  • Loading branch information
dockSquadron authored Mar 30, 2024
1 parent cb9d78d commit a4c9765
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/devices/neptune_r900.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ static int neptune_r900_decode(r_device *decoder, bitbuffer_t *bitbuffer)
uint8_t b[13]; // 104 bits
bitbuffer_extract_bytes(&bytes, 0, 0, b, sizeof(b)*8);

char raw[13];
snprintf(raw, sizeof(raw),"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12]);

Check warning on line 144 in src/devices/neptune_r900.c

View workflow job for this annotation

GitHub Actions / Build with CMake

‘%02x’ directive output truncated writing 2 bytes into a region of size 1 [-Wformat-truncation=]

Check warning on line 144 in src/devices/neptune_r900.c

View workflow job for this annotation

GitHub Actions / Build with CMake

‘%02x’ directive output truncated writing 2 bytes into a region of size 1 [-Wformat-truncation=]

// decode the data

// meter_id 32 bits
Expand Down Expand Up @@ -199,6 +202,7 @@ static int neptune_r900_decode(r_device *decoder, bitbuffer_t *bitbuffer)
"leak", "", DATA_INT, leak,
"leaknow", "", DATA_INT, leaknow,
"extra", "", DATA_STRING, extra,
"raw", "", DATA_STRING, raw,
NULL);
/* clang-format on */
decoder_output_data(decoder, data);
Expand Down Expand Up @@ -226,6 +230,7 @@ static char const *const output_fields[] = {
"leak",
"leaknow",
"extra",
"raw",
NULL,
};

Expand Down

0 comments on commit a4c9765

Please sign in to comment.