From c7af7169426b656c556715cbab8b3cacfdbc3e29 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 21 Jun 2023 18:49:12 +0200 Subject: [PATCH] style --- client/src/uart/uart_posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/uart/uart_posix.c b/client/src/uart/uart_posix.c index 86d76317b..c64d85db6 100644 --- a/client/src/uart/uart_posix.c +++ b/client/src/uart/uart_posix.c @@ -189,6 +189,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) { free(sp); return INVALID_SERIAL_PORT; } + int sfd = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); if (sfd == -1) { PrintAndLogEx(ERR, "Error opening Bluetooth socket"); @@ -196,6 +197,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) { free(sp); return INVALID_SERIAL_PORT; } + if (connect(sfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { PrintAndLogEx(ERR, "Error: cannot connect device " _YELLOW_("%s") " over Bluetooth", addrstr); close(sfd);