]> www.average.org Git - pulsecounter.git/blobdiff - linux/pulsecounter.c
separate reporting for jitter counters
[pulsecounter.git] / linux / pulsecounter.c
index 89568c98597a972c45fb24e562c03642558e58a9..cc05da904ce1f3d3acb6f09a881a7dc2615ff43a 100644 (file)
@@ -96,12 +96,17 @@ static void events_handler(const uint8_t *pdu, uint16_t len, gpointer user_data)
 
        handle = bt_get_le16(&pdu[1]);
        which = pdu[3];
-       if ((pdu[0] == 0x1b) && (handle == 0x0012) && (len == 9) &&
-           ((which == 1) || (which == 2))) {
+       if ((pdu[0] == 0x1b) && (handle == 0x0012) && (len == 9)) {
                uint32_t val = bt_get_le32(&pdu[5]);
-               g_debug("store: \"%hhu,%u\"\n", which, val);
-               if (dbstore(which, val))
-                       g_warning("error storing \"%hhu,%u\"\n", which, val);
+
+               if ((which == 1) || (which == 2)) {
+                       g_debug("store: \"%hhu,%u\"\n", which, val);
+                       if (dbstore(which, val))
+                               g_warning("error storing \"%hhu,%u\"\n",
+                                               which, val);
+               } else {
+                       g_debug("jitter: \"%hhu,%u\"\n", which, val);
+               }
        } else {
                time_t t;
                int i;