SNICInterface for ThingPlug Example
Dependents: ThingPlug_WiFi_Example ThingPlug_WiFi_Example_2
Fork of SNICInterface by
Diff: Socket/Socket.cpp
- Revision:
- 43:d80bbb12ffe6
- Parent:
- 41:1c1b5ad4d491
--- a/Socket/Socket.cpp Fri Sep 19 01:46:17 2014 +0000 +++ b/Socket/Socket.cpp Fri Nov 14 00:52:31 2014 +0000 @@ -49,11 +49,14 @@ { C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance(); C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand(); + + FUNC_IN(); // Get buffer for response payload from MemoryPool tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf(); if( payload_buf == NULL ) { DEBUG_PRINT("socket close payload_buf NULL\r\n"); + FUNC_OUT(); return -1; } @@ -80,6 +83,7 @@ { DEBUG_PRINT( "socket close failed\r\n" ); snic_core_p->freeCmdBuf( payload_buf ); + FUNC_OUT(); return -1; } @@ -87,10 +91,11 @@ { DEBUG_PRINT("socket close status:%02x\r\n", uartCmdMgr_p->getCommandStatus()); snic_core_p->freeCmdBuf( payload_buf ); + FUNC_OUT(); return -1; } snic_core_p->freeCmdBuf( payload_buf ); - + FUNC_OUT(); return 0; } @@ -98,11 +103,14 @@ { C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance(); C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand(); + + FUNC_IN(); // Get buffer for response payload from MemoryPool tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf(); if( payload_buf == NULL ) { DEBUG_PRINT("createSocket payload_buf NULL\r\n"); + FUNC_OUT(); return -1; } @@ -141,6 +149,7 @@ { DEBUG_PRINT( "createSocket failed\r\n" ); snic_core_p->freeCmdBuf( payload_buf ); + FUNC_OUT(); return -1; } @@ -148,11 +157,12 @@ { DEBUG_PRINT("createSocket status:%02x\r\n", uartCmdMgr_p->getCommandStatus()); snic_core_p->freeCmdBuf( payload_buf ); + FUNC_OUT(); return -1; } mSocketID = payload_buf->buf[3]; snic_core_p->freeCmdBuf( payload_buf ); - + FUNC_OUT(); return 0; } @@ -223,7 +233,6 @@ } snic_core_p->freeCmdBuf( payload_buf ); - return ip_addr; }