From c508f3b2f26f4096aec6bf54a3207cf7f08f785b Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 1 Feb 2016 20:52:14 +0000 Subject: [PATCH 1/2] oil_watchman: Return events count --- src/devices/oil_watchman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/oil_watchman.c b/src/devices/oil_watchman.c index e6913cff..c87f3f11 100644 --- a/src/devices/oil_watchman.c +++ b/src/devices/oil_watchman.c @@ -33,6 +33,7 @@ static int oil_watchman_callback(bitbuffer_t *bitbuffer) { data_t *data; unsigned bitpos = 0; bitbuffer_t databits = {0}; + int events = 0; local_time_str(0, time_str); @@ -91,8 +92,9 @@ static int oil_watchman_callback(bitbuffer_t *bitbuffer) { "depth", "", DATA_INT, depth, NULL); data_acquired_handler(data); + events++; } - return 0; + return events; }; static char *output_fields[] = { From 92ec0dbc33c231762d6934a95da7d074c0fd7dca Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 1 Feb 2016 20:52:45 +0000 Subject: [PATCH 2/2] emontx: Return events count --- src/devices/emontx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/emontx.c b/src/devices/emontx.c index 3a090ab4..cf04c3b2 100644 --- a/src/devices/emontx.c +++ b/src/devices/emontx.c @@ -39,6 +39,7 @@ static int emontx_callback(bitbuffer_t *bitbuffer) { bitrow_t *bb = bitbuffer->bb; unsigned bitpos = 0; unsigned bits = bitbuffer->bits_per_row[0]; + int events = 0; // Search for only 22 bits to cope with inverted frames and // the missing final preamble bit with RFM69 transmissions. @@ -125,8 +126,9 @@ static int emontx_callback(bitbuffer_t *bitbuffer) { words[10] == 3000 ? NULL : "temp6_C", "", DATA_FORMAT, "%.1f", DATA_DOUBLE, (double)words[10] / 10.0, NULL); data_acquired_handler(data); + events++; } - return 0; + return events; } static char *output_fields[] = { @@ -136,7 +138,7 @@ static char *output_fields[] = { }; r_device emontx = { - .name = "emonTx OpenEnergyMonitor (stub driver)", + .name = "emonTx OpenEnergyMonitor", .modulation = FSK_PULSE_PCM, .short_limit = 2000000.0 / (49230 + 49261), // 49261kHz for RFM69, 49230kHz for RFM12B .long_limit = 2000000.0 / (49230 + 49261),