Fixes for compiler warnings in BTLE example.
parent
6a165d8be1
commit
3629e9c721
|
@ -66,7 +66,7 @@ static int btle_get_read(BtleDev_t* dev)
|
||||||
return (dev->role == BTLE_ROLE_SERVER) ? dev->fdmiso : dev->fdmosi;
|
return (dev->role == BTLE_ROLE_SERVER) ? dev->fdmiso : dev->fdmosi;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int btle_send_block(BtleDev_t* dev, const void* buf, int len, int fd)
|
static int btle_send_block(BtleDev_t* dev, const unsigned char* buf, int len, int fd)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
ret = write(fd, buf, len);
|
ret = write(fd, buf, len);
|
||||||
|
@ -78,7 +78,7 @@ static int btle_send_block(BtleDev_t* dev, const void* buf, int len, int fd)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int btle_recv_block(BtleDev_t* dev, void* buf, int len, int fd)
|
static int btle_recv_block(BtleDev_t* dev, unsigned char* buf, int len, int fd)
|
||||||
{
|
{
|
||||||
fd_set set;
|
fd_set set;
|
||||||
int ret, pos = 0;
|
int ret, pos = 0;
|
||||||
|
@ -162,7 +162,7 @@ int btle_send(const unsigned char* buf, int len, int type, void* context)
|
||||||
header.ver = BTLE_VER;
|
header.ver = BTLE_VER;
|
||||||
header.type = type;
|
header.type = type;
|
||||||
header.len = len;
|
header.len = len;
|
||||||
ret = btle_send_block(dev, &header, sizeof(header), fd);
|
ret = btle_send_block(dev, (unsigned char*)&header, sizeof(header), fd);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
ret = btle_send_block(dev, buf, len, fd);
|
ret = btle_send_block(dev, buf, len, fd);
|
||||||
|
@ -179,7 +179,7 @@ int btle_recv(unsigned char* buf, int len, int* type, void* context)
|
||||||
int fd = btle_get_read(dev);
|
int fd = btle_get_read(dev);
|
||||||
|
|
||||||
|
|
||||||
ret = btle_recv_block(dev, &header, sizeof(header), fd);
|
ret = btle_recv_block(dev, (unsigned char*)&header, sizeof(header), fd);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue