From 3629e9c7210c861bc7f64b7f482c427bc4fd853a Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 2 Feb 2021 11:50:00 -0800 Subject: [PATCH 1/2] Fixes for compiler warnings in BTLE example. --- btle/btle-sim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/btle/btle-sim.c b/btle/btle-sim.c index 2a319999..03c88138 100644 --- a/btle/btle-sim.c +++ b/btle/btle-sim.c @@ -66,7 +66,7 @@ static int btle_get_read(BtleDev_t* dev) 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; 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; } -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; 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.type = type; 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) return ret; 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); - ret = btle_recv_block(dev, &header, sizeof(header), fd); + ret = btle_recv_block(dev, (unsigned char*)&header, sizeof(header), fd); if (ret < 0) return ret; From e6846d5f8eba06027bd81c2846d7ca44e04e83e8 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 2 Feb 2021 13:59:41 -0800 Subject: [PATCH 2/2] Fix minor spelling error. --- btle/btle-sim.c | 2 +- btle/ecc-client.c | 4 ++-- btle/ecc-server.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/btle/btle-sim.c b/btle/btle-sim.c index 03c88138..84d35785 100644 --- a/btle/btle-sim.c +++ b/btle/btle-sim.c @@ -1,6 +1,6 @@ /* btle-sim.c * - * Copyright (C) 2006-2020 wolfSSL Inc. + * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. (formerly known as CyaSSL) * diff --git a/btle/ecc-client.c b/btle/ecc-client.c index e29f15e8..4463472b 100644 --- a/btle/ecc-client.c +++ b/btle/ecc-client.c @@ -1,6 +1,6 @@ /* ecc-client.c * - * Copyright (C) 2006-2020 wolfSSL Inc. + * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. (formerly known as CyaSSL) * @@ -106,7 +106,7 @@ int main(int argc, char** argv) ret = -1; goto cleanup; } - /* TODO: Client should hash and verify this public key against trusted ceritifcate (already exchanged) */ + /* TODO: Client should hash and verify this public key against trusted certificate (already exchanged) */ /* ECC signature is about 65 bytes */ /* import peer public key */ diff --git a/btle/ecc-server.c b/btle/ecc-server.c index b01754f8..b0325cf4 100644 --- a/btle/ecc-server.c +++ b/btle/ecc-server.c @@ -1,6 +1,6 @@ /* ecc-server.c * - * Copyright (C) 2006-2020 wolfSSL Inc. + * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. (formerly known as CyaSSL) *