Skip to content

Commit

Permalink
minor: Fix more unexpected chars in input files
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Feb 7, 2024
1 parent a63bbf1 commit 55d5385
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 47 deletions.
2 changes: 1 addition & 1 deletion conf/energy_count_3000.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# "Voltcraft Energy Count 3000" (868.3 MHz) sensor sold by Conrad
# aka "Velleman NETBSEM4"
# aka "La Crosse Technology Remote Cost Control Monitor RS3620".
# aka "La Crosse Technology Remote Cost Control Monitor - RS3620".
# aka "ELV Cost Control"
#
# Stub driver
Expand Down
8 changes: 4 additions & 4 deletions src/devices/directv.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ each +/- 50 kHz from that center point.
A full signal TRANSMISSION consists of ROWS, which are collections of SYMBOLS.
SYMBOLS, both the higher-frequency MARK (`1`) and lower-frequency SPACE
(`0`), have a width of 600μs. If there is more than one ROW in a single
TRANSMISSION, there will be a GAP of 27,600μs of silence between each ROW.
(`0`), have a width of 600µs. If there is more than one ROW in a single
TRANSMISSION, there will be a GAP of 27,600µs of silence between each ROW.
A TRANSMISSION may be generated in response to an EVENT on the remote. Observed
EVENTS that may trigger a TRANSMISSION seem limited to manual button presses.
Expand Down Expand Up @@ -375,9 +375,9 @@ r_device const directv = {
.modulation = FSK_PULSE_PCM,
.short_width = 600, // 150 samples @250k
.long_width = 600, // 150 samples @250k
.gap_limit = 30000, // gap is typically around 27,600μs, so long that rtl_433 resets
.gap_limit = 30000, // gap is typically around 27,600µs, so long that rtl_433 resets
// signal decoder before recognizing row repeats in signal
.reset_limit = 50000, // maximum gap size before End Of Row [μs]
.reset_limit = 50000, // maximum gap size before End Of Row [µs]
.decode_fn = &directv_decode,
.fields = output_fields,
};
8 changes: 4 additions & 4 deletions src/devices/ert_idm.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ static int ert_idm_decode(r_device *decoder, bitbuffer_t *bitbuffer)
http://davestech.blogspot.com/2008/02/itron-remote-read-electric-meter.html
SCM1 Counter1 Meter has been inverted
SCM1 Counter2 Meter has been removed
SCM2 Counter3 Meter detected a buttonpress demand reset
SCM2 Counter4 Meter has a low-battery/end–of–calendar warning
SCM2 Counter3 Meter detected a button-press demand reset
SCM2 Counter4 Meter has a low-battery/end-of-calendar warning
SCM3 Counter5 Meter has an error or a warning that can affect billing
SCM3 Counter6 Meter has a warning that may or may not require a site visit,
*/
Expand Down Expand Up @@ -440,8 +440,8 @@ static int ert_netidm_decode(r_device *decoder, bitbuffer_t *bitbuffer)
http://davestech.blogspot.com/2008/02/itron-remote-read-electric-meter.html
SCM1 Counter1 Meter has been inverted
SCM1 Counter2 Meter has been removed
SCM2 Counter3 Meter detected a buttonpress demand reset
SCM2 Counter4 Meter has a low-battery/end–of–calendar warning
SCM2 Counter3 Meter detected a button-press demand reset
SCM2 Counter4 Meter has a low-battery/end-of-calendar warning
SCM3 Counter5 Meter has an error or a warning that can affect billing
SCM3 Counter6 Meter has a warning that may or may not require a site visit,
*/
Expand Down
6 changes: 3 additions & 3 deletions src/devices/fineoffset.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static int fineoffset_WH24_callback(r_device *decoder, bitbuffer_t *bitbuffer)
int humidity = b[5]; // 0xff if invalid
int wind_speed_raw = b[6] | (b[3] & 0x10) << 4; // 0x1ff if invalid
float wind_speed_factor, rain_cup_count;
// Wind speed factor is 1.12 m/s (1.19 per specs?) for WH24, 0.51 m/s for WH65B
// Wind speed factor is 1.12 m/s (1.19 per specs?) for WH24, 0.51 m/s for WH65B
// Rain cup each count is 0.3mm for WH24, 0.01inch (0.254mm) for WH65B
if (type == MODEL_WH24) { // WH24
wind_speed_factor = 1.12f;
Expand All @@ -259,7 +259,7 @@ static int fineoffset_WH24_callback(r_device *decoder, bitbuffer_t *bitbuffer)
wind_speed_factor = 0.51f;
rain_cup_count = 0.254f;
}
// Wind speed is scaled by 8, wind speed = raw / 8 * 1.12 m/s (0.51 for WH65B)
// Wind speed is scaled by 8, wind speed = raw / 8 * 1.12 m/s (0.51 for WH65B)
float wind_speed_ms = wind_speed_raw * 0.125f * wind_speed_factor;
int gust_speed_raw = b[7]; // 0xff if invalid
// Wind gust is unscaled, multiply by wind speed factor 1.12 m/s
Expand Down Expand Up @@ -590,7 +590,7 @@ Data format:
See http://www.ecowitt.com/upfile/201904/WH51%20Manual.pdf for relationship between AD and moisture %
Short explanation:
- Soil Moisture Percentage = (Moisture AD 0%AD) / (100%AD 0%AD) * 100
- Soil Moisture Percentage = (Moisture AD - 0%AD) / (100%AD - 0%AD) * 100
- 0%AD = 70
- 100%AD = 450 (manual states 500, but sensor internal computation are closer to 450)
- If sensor-calculated moisture percentage are inaccurate at low/high values, use the AD value and the above formaula
Expand Down
4 changes: 2 additions & 2 deletions src/devices/funkbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ developed by Insta GmbH.
- Preamble: 4000us
- Short: 500us
- Long: 1000us
- Encoding: Differential Manchester BiphaseMark (BP-M)
- Encoding: Differential Manchester Biphase-Mark (BP-M)
__ __ __ __ __ __
| | | | | | | |
_| |__ __| |__| |__| |__.....
| 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 0 | 1 |
- Mic: parity + lfsr with 8bit mask 0x8C shifted left by 2 bit
- Bits: 48
Expand Down
2 changes: 1 addition & 1 deletion src/devices/govee.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static int govee_decode(r_device *decoder, bitbuffer_t *bitbuffer)
chk = (chk >> 4) ^ (chk & 0xf);

// Parity arguments were discovered using revdgst's RevSum and the data packets included at the top of this file.
// https://github.com/triq-org/revdgst
// https://github.com/triq-org/revdgst
if (chk != parity) {
decoder_log(decoder, 1, __func__, "Parity did NOT match.");
return DECODE_FAIL_MIC;
Expand Down
2 changes: 1 addition & 1 deletion src/devices/m_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ static int m_bus_decode_records(data_t *data, const uint8_t *b, uint8_t dif_codi
} else if (vif_uam == 0x78) {
// E111 1000 Fabrication No
} else if (vif_uam == 0x79) {
// E111 1001 Enhanced Identification••
// E111 1001 Enhanced Identification
} else if (vif_uam == 0x7A) {
// E111 1010 Bus Address data type C (x=8)
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/devices/secplus_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ Find index of next bursts/packets in bitbuffer.
The transmissions do not have a magic number or preamble.
They all start with a '0' or a '2'  represented at 0001. and 0111.
They all start with a '0' or a '2' represented at 0001. and 0111.
since all nibbles start with 0 we can look for bytes
000 + 0001 + 0 and 000 + 0111 + 0 for the start of a transmission
000 + 0001 + 0 and 000 + 0111 + 0 for the start of a transmission
(or just the 0001 and 0111 at the start of a bitbuffer)
*/

Expand Down
4 changes: 2 additions & 2 deletions src/devices/ttx201.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ A complete message is 445 bits:
54-bit data packet format
0 1 2 3 4 5 6 7 8 9 10 11 12 13 (nibbles #, aligned to 8-bit values)
..LL LLKKKKKK IIIIIIII StttBCCC 0XXXTTTT TTTTTTTT MMMMMMMM JJJJ (temperature)
or ..LL LLKKKKKK zyyyyyyy 0tttmmmm dddddHHH HHMMMMMM 0SSSSSS? JJJJ (date/time)
..LL LLKKKKKK IIIIIIII StttBCCC 0XXXTTTT TTTTTTTT MMMMMMMM JJJJ (temperature)
or ..LL LLKKKKKK zyyyyyyy 0tttmmmm dddddHHH HHMMMMMM 0SSSSSS? JJJJ (date/time)
- L = 4-bit start of packet, always 0
- K = 6-bit checksum, sum of nibbles 3-12
Expand Down
10 changes: 5 additions & 5 deletions src/devices/vauno_en8822c.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Sample Data:
[00] {42} af 0f a2 7c 01 c0 : 10101111 00001111 10100010 01111100 00000001 11
- Sensor ID = 175 = 0xaf
- Channel = 0
- temp = -93 = 0x111110100010
- TemperatureC = -9.3
- hum = 62% = 0x0111110
- Sensor ID = 175 = 0xaf
- Channel = 0
- temp = -93 = 0x111110100010
- TemperatureC = -9.3
- hum = 62% = 0x0111110
*/

Expand Down
47 changes: 25 additions & 22 deletions tests/data-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,33 @@

int main(void)
{
data_t *data = data_make("label" , "", DATA_STRING, "1.2.3",
"house_code" , "House Code", DATA_INT, 42,
"temp" , "Temperature", DATA_DOUBLE, 99.9,
"array" , "Array", DATA_ARRAY, data_array(2, DATA_STRING, (char*[2]){"hello", "world"}),
"array2" , "Array 2", DATA_ARRAY, data_array(2, DATA_INT, (int[2]){4, 2}),
"array3" , "Array 3", DATA_ARRAY, data_array(2, DATA_ARRAY, (data_array_t*[2]){
data_array(2, DATA_INT, (int[2]){4, 2}),
data_array(2, DATA_INT, (int[2]){5, 5}) }),
"data" , "Data", DATA_DATA, data_make("Hello", "hello", DATA_STRING, "world", NULL),
NULL);
const char *fields[] = { "label", "house_code", "temp", "array", "array2", "array3", "data", "house_code" };
/* clang-format off */
data_t *data = data_make(
"label", "", DATA_STRING, "1.2.3",
"house_code", "House Code", DATA_INT, 42,
"temp", "Temperature", DATA_DOUBLE, 99.9,
"array", "Array", DATA_ARRAY, data_array(2, DATA_STRING, (char*[2]){"hello", "world"}),
"array2", "Array 2", DATA_ARRAY, data_array(2, DATA_INT, (int[2]){4, 2}),
"array3", "Array 3", DATA_ARRAY, data_array(2, DATA_ARRAY, (data_array_t*[2]){
data_array(2, DATA_INT, (int[2]){4, 2}),
data_array(2, DATA_INT, (int[2]){5, 5}) }),
"data", "Data", DATA_DATA, data_make("Hello", "hello", DATA_STRING, "world", NULL),
NULL);
/* clang-format on */
const char *fields[] = { "label", "house_code", "temp", "array", "array2", "array3", "data", "house_code" };

void *json_output = data_output_json_create(0, stdout);
void *kv_output = data_output_kv_create(0, stdout);
void *csv_output = data_output_csv_create(0, stdout);
data_output_start(csv_output, fields, sizeof fields / sizeof *fields);
void *json_output = data_output_json_create(0, stdout);
void *kv_output = data_output_kv_create(0, stdout);
void *csv_output = data_output_csv_create(0, stdout);
data_output_start(csv_output, fields, sizeof fields / sizeof *fields);

data_output_print(json_output, data); fprintf(stdout, "\n");
data_output_print(kv_output, data);
data_output_print(csv_output, data);
data_output_print(json_output, data); fprintf(stdout, "\n");
data_output_print(kv_output, data);
data_output_print(csv_output, data);

data_output_free(json_output);
data_output_free(kv_output);
data_output_free(csv_output);
data_output_free(json_output);
data_output_free(kv_output);
data_output_free(csv_output);

data_free(data);
data_free(data);
}

0 comments on commit 55d5385

Please sign in to comment.