Skip to content

Commit

Permalink
Quieten status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
DeanCording committed Apr 19, 2018
1 parent 61470de commit dd8528d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions owonb35.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include <gattlib.h>

#define VERSION "1.4"
#define VERSION "1.4.0"

_Bool quiet = FALSE;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit dd8528d

Please sign in to comment.