mirror of https://github.com/labapart/gattlib
bluez(4|5): Fixed ambiguity with variable names
parent
ed3ff0627f
commit
07a4e011da
|
@ -179,16 +179,16 @@ static int l2cap_connect(int sock, const bdaddr_t *dst, uint8_t dst_type,
|
||||||
struct sockaddr_l2 addr;
|
struct sockaddr_l2 addr;
|
||||||
|
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
struct timeval timeout;
|
struct timeval timeval;
|
||||||
timeout.tv_sec = 2;
|
timeval.tv_sec = timeout;
|
||||||
timeout.tv_usec = 0;
|
timeval.tv_usec = 0;
|
||||||
|
|
||||||
if (setsockopt (sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout)) < 0) {
|
if (setsockopt (sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeval, sizeof(timeval)) < 0) {
|
||||||
fprintf(stderr, "l2cap_connect: Failed to setsockopt for receive timeout.\n");
|
fprintf(stderr, "l2cap_connect: Failed to setsockopt for receive timeout.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt (sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, sizeof(timeout)) < 0) {
|
if (setsockopt (sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeval, sizeof(timeval)) < 0) {
|
||||||
fprintf(stderr, "l2cap_connect: Failed to setsockopt for sending timeout.\n");
|
fprintf(stderr, "l2cap_connect: Failed to setsockopt for sending timeout.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,16 +352,16 @@ static int l2cap_connect(int sock, const bdaddr_t *dst, uint8_t dst_type,
|
||||||
struct sockaddr_l2 addr;
|
struct sockaddr_l2 addr;
|
||||||
|
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
struct timeval timeout;
|
struct timeval timeval;
|
||||||
timeout.tv_sec = 2;
|
timeval.tv_sec = timeout;
|
||||||
timeout.tv_usec = 0;
|
timeval.tv_usec = 0;
|
||||||
|
|
||||||
if (setsockopt (sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout)) < 0) {
|
if (setsockopt (sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeval, sizeof(timeval)) < 0) {
|
||||||
fprintf(stderr, "l2cap_connect: Failed to setsockopt for receive timeout.\n");
|
fprintf(stderr, "l2cap_connect: Failed to setsockopt for receive timeout.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt (sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, sizeof(timeout)) < 0) {
|
if (setsockopt (sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeval, sizeof(timeval)) < 0) {
|
||||||
fprintf(stderr, "l2cap_connect: Failed to setsockopt for sending timeout.\n");
|
fprintf(stderr, "l2cap_connect: Failed to setsockopt for sending timeout.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue