Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
Diff: internal/types/Socket.cpp
- Revision:
- 6:8a87a59d0d21
- Parent:
- 1:6ec9998427ad
- Child:
- 16:7f1d6d359787
--- a/internal/types/Socket.cpp Mon Aug 11 04:00:39 2014 -0700 +++ b/internal/types/Socket.cpp Mon Aug 11 13:55:07 2014 -0700 @@ -8,7 +8,6 @@ * written permission of ACKme Networks. */ -#include <assert.h> #include <stdarg.h> #include "Wiconnect.h" #include "internal/common.h" @@ -37,12 +36,12 @@ if(txBuffer_ == NULL) { #ifdef WICONNECT_ENABLE_MALLOC - assert(wiconnect->_malloc != NULL); + wiconnect_assert(wiconnect, "Socket(), malloc not defined", wiconnect->_malloc != NULL); txBuffer.buffer = (uint8_t*)wiconnect->_malloc(txBufferLen_); - assert(txBuffer.buffer != NULL); + wiconnect_assert(wiconnect, "Socket(), txBuffer malloc failed", txBuffer.buffer != NULL); txBuffer.allocated = true; #else - assert(0); + wiconnect_assert(0); #endif } } @@ -52,12 +51,12 @@ if(rxBuffer_ == NULL) { #ifdef WICONNECT_ENABLE_MALLOC - assert(wiconnect->_malloc != NULL); + wiconnect_assert(wiconnect, "Socket(), malloc not defined", wiconnect->_malloc != NULL); rxBuffer.buffer = (uint8_t*)wiconnect->_malloc(rxBufferLen_); - assert(rxBuffer.buffer != NULL); + wiconnect_assert(wiconnect, "Socket(), rxBuffer malloc failed", rxBuffer.buffer != NULL); rxBuffer.allocated = true; #else - assert(0); + wiconnect_assert(0); #endif } } @@ -93,12 +92,12 @@ #ifdef WICONNECT_ENABLE_MALLOC if(txBuffer.allocated && txBuffer.size > 0) { - assert(wiconnect->_free != NULL); + wiconnect_assert(wiconnect, "~Socket(), free not defined", wiconnect->_free != NULL); wiconnect->_free(txBuffer.buffer); } if(rxBuffer.allocated && rxBuffer.size > 0) { - assert(wiconnect->_free != NULL); + wiconnect_assert(wiconnect, "~Socket(), free not defined", wiconnect->_free != NULL); wiconnect->_free(rxBuffer.buffer); } #endif