From dd8528ddaeb546b5fa496df6a96220c08d424423 Mon Sep 17 00:00:00 2001 From: Dean Cording Date: Thu, 19 Apr 2018 18:16:08 +1000 Subject: [PATCH] Quieten status messages --- owonb35.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/owonb35.c b/owonb35.c index 428a7ce..4f3a588 100644 --- a/owonb35.c +++ b/owonb35.c @@ -37,7 +37,7 @@ #include -#define VERSION "1.4" +#define VERSION "1.4.0" _Bool quiet = FALSE; @@ -558,7 +558,7 @@ static void ble_discovered_device(const char* addr, const char* name) { if ((name != NULL) && (strcmp(BDM, name) == 0) && (address == NULL)) { - if (!quiet) fprintf(stderr, "Connecting to %s\n", addr); + if (!quiet) fprintf(stderr, "Found %s\n", addr); address = malloc(18); strcpy(address,addr); @@ -571,9 +571,10 @@ static void ble_discovered_device(const char* addr, const char* name) { void connect_device() { do { + if (!quiet) fprintf(stderr, "Connecting...\n"); connection = gattlib_connect(NULL, address, BDADDR_LE_PUBLIC, BT_SEC_LOW, 0, 0); if (connection == NULL) { - fprintf(stderr, "Fail to connect to the multimeter bluetooth device.\n"); + if (!quiet) fprintf(stderr, "Fail to connect to the multimeter bluetooth device.\n"); sleep(1); } } while (connection == NULL);