From a532bc12d3b64140c51e34324ee5e2cf71c21a93 Mon Sep 17 00:00:00 2001 From: cassy73 Date: Tue, 3 Jan 2017 11:35:01 +0100 Subject: [PATCH] Correct _write function return --- UIPClient.cpp | 9 +++++---- UIPClient.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/UIPClient.cpp b/UIPClient.cpp index fc24d05..761e7b4 100644 --- a/UIPClient.cpp +++ b/UIPClient.cpp @@ -139,10 +139,10 @@ UIPClient::stop() _dumpAllData(); #endif } -#if ACTLOGLEVEL>=LOG_DEBUG +#if ACTLOGLEVEL>=LOG_DEBUG_V3 else { - LogObject.uart_send_strln(F("UIPClient::stop() DEBUG:stop(), data: NULL")); + LogObject.uart_send_strln(F("UIPClient::stop() DEBUG_V3:stop(), data: NULL")); } #endif data = NULL; @@ -194,7 +194,7 @@ UIPClient::write(const uint8_t *buf, size_t size) return _write(data, buf, size); } -int16_t +uint16_t UIPClient::_write(uip_userdata_t* u, const uint8_t *buf, size_t size) { #if ACTLOGLEVEL>=LOG_DEBUG_V3 @@ -271,7 +271,8 @@ UIPClient::_write(uip_userdata_t* u, const uint8_t *buf, size_t size) #endif return size-remain; } - return -1; + //return -1; -1 is wrong because return type is unsigned + return 0; } int diff --git a/UIPClient.h b/UIPClient.h index cc54e46..7d15d17 100644 --- a/UIPClient.h +++ b/UIPClient.h @@ -102,7 +102,7 @@ typedef struct { static uip_userdata_t all_data[UIP_CONNS]; static uip_userdata_t* _allocateData(); - static int16_t _write(uip_userdata_t *,const uint8_t *buf, size_t size); + static uint16_t _write(uip_userdata_t *,const uint8_t *buf, size_t size); static int _available(uip_userdata_t *); static uint8_t _currentBlock(memhandle* blocks);