for EthernetInterface library compatibility.\\ ** Unoffical fix. may be a problem. **
Dependents: SNIC-httpclient-example SNIC-ntpclient-example
Fork of SNICInterface by
Revision 29:6a0ba999597d, committed 2014-05-26
- Comitter:
- kishino
- Date:
- Mon May 26 05:17:28 2014 +0000
- Parent:
- 28:b796031f6519
- Child:
- 30:944b8c04b5ff
- Commit message:
- Changed the receive logic of UART.; Changed the use area of the global buffer.
Changed in this revision
--- a/SNIC/MurataObject.cpp Tue Apr 01 07:19:19 2014 +0000 +++ b/SNIC/MurataObject.cpp Mon May 26 05:17:28 2014 +0000 @@ -13,5 +13,4 @@ #include "MurataObject.h" #include "stdarg.h" -using namespace murata_wifi;
--- a/SNIC/MurataObject.h Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC/MurataObject.h Mon May 26 05:17:28 2014 +0000
@@ -14,11 +14,8 @@
#define _MURATA_OBJECT_H_
#include "mbed.h"
-namespace murata_wifi
-{
class C_MurataObject{
};
-}
#endif
--- a/SNIC/SNIC_Core.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC/SNIC_Core.cpp Mon May 26 05:17:28 2014 +0000
@@ -15,18 +15,32 @@
#include "SNIC_UartMsgUtil.h"
#include <string>
-using namespace murata_wifi;
+/** Wait signal ID of UART recv */
+#define UART_DISPATCH_SIGNAL 0x00000002
+#define UART_RECEIVE_SIGNAL 0x00000004
-#define UART_RECVBUF_SIZE 2048
+#define UART_RECVBUF_SIZE 2048
+#define UART_THREAD_STACK_SIZE 512
+
typedef struct
{
- unsigned char buf[UART_RECVBUF_SIZE];
+ tagMEMPOOL_BLOCK_T *mem_p;
unsigned int size;
- bool is_receive;
}tagUART_RECVBUF_T;
-tagUART_RECVBUF_T gUART_RCVBUF;
-unsigned char gUART_TEMP_BUF[UART_RECVBUF_SIZE];
+/*
+ Define the global buffer using the area for Ethernet.
+*/
+unsigned char gUART_TEMP_BUF[UART_RECVBUF_SIZE] __attribute__((section("AHBSRAM1")));
+unsigned char gUART_COMMAND_BUF[UART_REQUEST_PAYLOAD_MAX] __attribute__((section("AHBSRAM1")));
+unsigned char gPAYLOAD_ARRAY[UART_REQUEST_PAYLOAD_MAX] __attribute__((section("AHBSRAM1")));
+/** MemoryPool for payload of UART response */
+MemoryPool<tagMEMPOOL_BLOCK_T, MEMPOOL_PAYLOAD_NUM> mMemPoolPayload __attribute__((section("AHBSRAM1")));
+/** MemoryPool for UART receive */
+MemoryPool<tagMEMPOOL_BLOCK_T, MEMPOOL_UART_RECV_NUM> mMemPoolUartRecv __attribute__((section("AHBSRAM1")));
+Queue<tagMEMPOOL_BLOCK_T, MEMPOOL_UART_RECV_NUM> mUartRecvQueue;
+
+tagMEMPOOL_BLOCK_T *gUART_RCVBUF_p;
C_SNIC_Core *C_SNIC_Core::mInstance_p = NULL;
C_SNIC_Core *C_SNIC_Core::getInstance()
@@ -49,13 +63,26 @@
mConnectInfo[i].is_connected = false;
}
- mUartRecvThread_p = NULL;
+ mUartRecvThread_p = NULL;
+ mUartRecvDispatchThread_p = NULL;
}
C_SNIC_Core::~C_SNIC_Core()
{
}
+int C_SNIC_Core::resetModule( PinName reset )
+{
+ DigitalOut reset_pin( reset );
+
+ reset_pin = 0;
+ wait(0.2);
+ reset_pin = 1;
+ wait(0.2);
+
+ return 0;
+}
+
int C_SNIC_Core::initUart(PinName tx, PinName rx, int baud)
{
// printf("[C_SNIC_Core::initUart]1\r\n");
@@ -65,36 +92,32 @@
mUart_p = new RawSerial( tx, rx );
mUart_p->baud( baud );
mUart_p->format(8, SerialBase::None, 1);
-
-// printf("[C_SNIC_Core::initUart]2\r\n");
+
// Initialize uart
- gUART_RCVBUF.is_receive = false;
- gUART_RCVBUF.size = 0;
+ gUART_RCVBUF_p = NULL;
- // Create UART recv thread
- mUartRecvThread_p = new Thread( C_SNIC_Core::uartRecvThread );
-// printf("[C_SNIC_Core::initUart]3\r\n");
- if( mUartRecvThread_p == NULL )
+ mUart_p->attach( C_SNIC_Core::uartRecvCallback );
+ // Create UART recv dispatch thread
+ mUartRecvDispatchThread_p = new Thread( C_SNIC_Core::uartRecvDispatchThread, NULL, osPriorityNormal, UART_THREAD_STACK_SIZE);
+ if( mUartRecvDispatchThread_p == NULL )
{
- printf("[C_SNIC_Core::initUart] thread cread failed\r\n");
+ printf("[C_SNIC_Core::initUart] thread create failed\r\n");
return -1;
}
return 0;
}
-
-unsigned int C_SNIC_Core::preparationSendCommand( unsigned char cmd_id, unsigned char cmd_sid
+unsigned int C_SNIC_Core::preparationSendCommand( unsigned char cmd_id, unsigned char cmd_sid
, unsigned char *req_buf_p, unsigned int req_buf_len
, unsigned char *response_buf_p, unsigned char *command_p )
{
- unsigned char payload_array[UART_REQUEST_PAYLOAD_MAX];
unsigned short payload_len;
unsigned int command_len = 0;
// Make command payload
- payload_len = C_SNIC_UartMsgUtil::makePayload( req_buf_len, req_buf_p, payload_array );
+ payload_len = C_SNIC_UartMsgUtil::makePayload( req_buf_len, req_buf_p, gPAYLOAD_ARRAY );
// Make all command request
- command_len = C_SNIC_UartMsgUtil::makeRequest( cmd_id, payload_array, payload_len, command_p );
+ command_len = C_SNIC_UartMsgUtil::makeRequest( cmd_id, gPAYLOAD_ARRAY, payload_len, command_p );
// Set data for response
mUartCommand_p->setCommandID( cmd_id );
@@ -107,7 +130,6 @@
int C_SNIC_Core::sendUart( unsigned int len, unsigned char *data )
{
int ret = 0;
-
mUartMutex.lock();
for( int i = 0; i < len; i++ )
{
@@ -123,7 +145,7 @@
return ret;
}
-C_SNIC_Core::tagMEMPOOL_BLOCK_T *C_SNIC_Core::allocCmdBuf()
+tagMEMPOOL_BLOCK_T *C_SNIC_Core::allocCmdBuf()
{
// Get buffer from MemoryPool
return mMemPoolPayload.alloc();
@@ -134,6 +156,17 @@
mMemPoolPayload.free( buf_p );
}
+tagMEMPOOL_BLOCK_T *C_SNIC_Core::allocUartRcvBuf()
+{
+ // Get buffer from MemoryPool
+ return mMemPoolUartRecv.alloc();
+}
+
+void C_SNIC_Core::freeUartRecvBuf( tagMEMPOOL_BLOCK_T *buf_p )
+{
+ mMemPoolUartRecv.free( buf_p );
+}
+
C_SNIC_Core::tagCONNECT_INFO_T *C_SNIC_Core::getConnectInfo( int socket_id )
{
if( (socket_id < 0) || (socket_id > MAX_SOCKET_ID) )
@@ -148,82 +181,46 @@
return mUartCommand_p;
}
-DigitalOut led1(LED1);
-void C_SNIC_Core::uartRecvThread (void const *args_p) {
+unsigned char *C_SNIC_Core::getCommandBuf()
+{
+ return gUART_COMMAND_BUF;
+}
+DigitalOut led1(LED1);
+
+void C_SNIC_Core::uartRecvCallback( void )
+{
C_SNIC_Core *instance_p = C_SNIC_Core::getInstance();
- if ( instance_p == NULL )
+ if( instance_p != NULL )
{
- printf("Socket constructor error: no wifly instance available!\r\n");
- }
- C_SNIC_UartCommandManager *uartCmdMgr_p = instance_p->getUartCommand();
+ int recvdata = 0;
- int recvdata = 0;
- int i;
-
- /* UART recv thread main loop */
- for (;;)
- {
- while( instance_p->mUart_p->readable() )
+ // set signal
+// instance_p->mUartRecvThread_p->signal_set( UART_RECEIVE_SIGNAL );
+ if( instance_p->mUart_p->readable() )
{
// Receive data from UART.
instance_p->mUartMutex.lock();
recvdata = instance_p->mUart_p->getc();
instance_p->mUartMutex.unlock();
- // Check UART receiving flg
- if( gUART_RCVBUF.is_receive )
+ // Check UART receiving buffer
+ if( gUART_RCVBUF_p != NULL )
{
- gUART_RCVBUF.buf[ gUART_RCVBUF.size ] = (unsigned char)recvdata;
- gUART_RCVBUF.size++;
+ gUART_RCVBUF_p->buf[ gUART_RCVBUF_p->size ] = (unsigned char)recvdata;
+ gUART_RCVBUF_p->size++;
+
// Check received data is EOM.
if( recvdata == UART_CMD_EOM )
{
led1 = 0;
-#if 0
- printf("[recv]\r\n");
- for( i = 0; i < gUART_RCVBUF.size; i++ )
- {
- printf("%02x ", gUART_RCVBUF.buf[i]);
- }
- printf("\r\n");
-#endif
- unsigned char command_id;
- // Get payload from received data from UART.
- int payload_len = C_SNIC_UartMsgUtil::getResponsePayload( gUART_RCVBUF.size, gUART_RCVBUF.buf
- , &command_id, gUART_TEMP_BUF );
-
- // Check receive a TCP or UDP packet
- if( (command_id == UART_CMD_ID_SNIC) && (gUART_TEMP_BUF[0] == UART_CMD_SID_SNIC_CONNECTION_RECV_IND) )
- {
- // Packet buffering
- uartCmdMgr_p->bufferredPacket( gUART_TEMP_BUF, payload_len );
- }
-
- // Check scan results indication
- else if( (command_id == UART_CMD_ID_WIFI) && (gUART_TEMP_BUF[0] == UART_CMD_SID_WIFI_SCAN_RESULT_IND) )
- {
- // Scan result indicate
- uartCmdMgr_p->scanResultIndicate( gUART_TEMP_BUF, payload_len );
- }
- // Checks in the command which is waiting.
- else if( uartCmdMgr_p->isWaitingCommand(command_id, gUART_TEMP_BUF) )
- {
- // Get buffer for payload data
- unsigned char *payload_buf_p = uartCmdMgr_p->getResponseBuf();
- if( payload_buf_p != NULL )
- {
- memcpy( payload_buf_p, gUART_TEMP_BUF, payload_len );
- uartCmdMgr_p->setResponseBuf( NULL );
- }
- // Set status
- uartCmdMgr_p->setCommandStatus( gUART_TEMP_BUF[2] );
- // Set signal for command response wait.
- uartCmdMgr_p->signal();
- }
+ // Add queue
+ mUartRecvQueue.put( gUART_RCVBUF_p );
- gUART_RCVBUF.size = 0;
- gUART_RCVBUF.is_receive = false;
+ gUART_RCVBUF_p = NULL;
+
+ // set signal for dispatch thread
+ instance_p->mUartRecvDispatchThread_p->signal_set( UART_DISPATCH_SIGNAL );
}
}
else
@@ -232,15 +229,90 @@
if( recvdata == UART_CMD_SOM )
{
led1 = 1;
- gUART_RCVBUF.size = 0;
- gUART_RCVBUF.buf[ gUART_RCVBUF.size ] = (unsigned char)recvdata;
- gUART_RCVBUF.size++;
- gUART_RCVBUF.is_receive = true;
+ gUART_RCVBUF_p = instance_p->allocUartRcvBuf();
+ gUART_RCVBUF_p->size = 0;
+ // get buffer for Uart receive
+ gUART_RCVBUF_p->buf[ 0 ] = (unsigned char)recvdata;
+
+ gUART_RCVBUF_p->size++;
}
}
-// Thread::yield();
}
- Thread::yield();
}
}
+void C_SNIC_Core::uartRecvDispatchThread (void const *args_p)
+{
+ C_SNIC_Core *instance_p = C_SNIC_Core::getInstance();
+ C_SNIC_UartCommandManager *uartCmdMgr_p = instance_p->getUartCommand();
+
+ tagMEMPOOL_BLOCK_T *uartRecvBuf_p;
+ osEvent evt;
+
+ for(;;)
+ {
+ // wait
+ Thread::signal_wait( UART_DISPATCH_SIGNAL );
+
+ // Get scanresults from queue
+ evt = mUartRecvQueue.get(500);
+ if (evt.status == osEventMessage)
+ {
+ do
+ {
+ uartRecvBuf_p = (tagMEMPOOL_BLOCK_T *)evt.value.p;
+
+ {
+ int i;
+ printf("[rcv]:%d",uartRecvBuf_p->size );
+/*
+ for(i=0;i<uartRecvBuf_p->size;i++)
+ {
+ printf("%02x", uartRecvBuf_p->buf[i]);
+ }
+*/
+ printf("\r\n");
+ }
+
+ unsigned char command_id;
+ // Get payload from received data from UART.
+ int payload_len = C_SNIC_UartMsgUtil::getResponsePayload( uartRecvBuf_p->size, uartRecvBuf_p->buf
+ , &command_id, gUART_TEMP_BUF );
+ // Check receive a TCP or UDP packet
+ if( (command_id == UART_CMD_ID_SNIC) && (gUART_TEMP_BUF[0] == UART_CMD_SID_SNIC_CONNECTION_RECV_IND) )
+ {
+ // Packet buffering
+ uartCmdMgr_p->bufferredPacket( gUART_TEMP_BUF, payload_len );
+ }
+ // Check scan results indication
+ else if( (command_id == UART_CMD_ID_WIFI) && (gUART_TEMP_BUF[0] == UART_CMD_SID_WIFI_SCAN_RESULT_IND) )
+ {
+ // Scan result indicate
+ uartCmdMgr_p->scanResultIndicate( gUART_TEMP_BUF, payload_len );
+ }
+ // Checks in the command which is waiting.
+ else if( uartCmdMgr_p->isWaitingCommand(command_id, gUART_TEMP_BUF) )
+ {
+ //lcd_printf("cid:%02x scid:%02x\r\n", command_id, gUART_TEMP_BUF[0]);
+
+ // Get buffer for payload data
+ unsigned char *payload_buf_p = uartCmdMgr_p->getResponseBuf();
+ if( payload_buf_p != NULL )
+ {
+ memcpy( payload_buf_p, gUART_TEMP_BUF, payload_len );
+ uartCmdMgr_p->setResponseBuf( NULL );
+ }
+ // Set status
+ uartCmdMgr_p->setCommandStatus( gUART_TEMP_BUF[2] );
+ // Set signal for command response wait.
+ uartCmdMgr_p->signal();
+ }
+ //
+ instance_p->freeUartRecvBuf( uartRecvBuf_p );
+
+ evt = mUartRecvQueue.get(500);
+ Thread::yield();
+ } while( evt.status == osEventMessage );
+ }
+ }
+}
--- a/SNIC/SNIC_Core.h Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC/SNIC_Core.h Mon May 26 05:17:28 2014 +0000
@@ -21,14 +21,14 @@
#include "SNIC_UartCommandManager.h"
-namespace murata_wifi
-{
-#define UART_REQUEST_PAYLOAD_MAX 256
+#define UART_REQUEST_PAYLOAD_MAX 1024
#define MEMPOOL_BLOCK_SIZE 2048
#define MEMPOOL_PAYLOAD_NUM 1
#define MAX_SOCKET_ID 5
+#define MEMPOOL_UART_RECV_NUM 2
+
/** Wi-Fi security
*/
typedef enum SECURITY {
@@ -59,6 +59,14 @@
e_AP_STARTED
}E_WIFI_STATUS;
+/** Memorypool
+ */
+typedef struct
+{
+ unsigned int size;
+ unsigned char buf[MEMPOOL_BLOCK_SIZE];
+}tagMEMPOOL_BLOCK_T;
+
/** Internal class used by any other classes. This class is singleton.
*/
class C_SNIC_Core: public C_MurataObject
@@ -69,13 +77,6 @@
friend class Socket;
private:
- /** Memorypool for SNIC UART Response
- */
- typedef struct
- {
- unsigned char buf[MEMPOOL_BLOCK_SIZE];
- }tagMEMPOOL_BLOCK_T;
-
/** Wi-Fi Network type
*/
typedef enum NETWORK_TYPE {
@@ -88,7 +89,7 @@
/** Connection information
*/
typedef struct {
- CircBuffer<unsigned char> *recvbuf_p;
+ CircBuffer<char> *recvbuf_p;
bool is_connected;
bool is_received;
}tagCONNECT_INFO_T;
@@ -177,14 +178,6 @@
unsigned char seq;
}tagWIFI_GET_STA_RSSI_REQ_T;
- /** WIFI_GET_STATUS_REQ Command */
- typedef struct
- {
- unsigned char cmd_sid;
- unsigned char seq;
- unsigned char interface;
- }tagWIFI_GET_STATUS_REQ_T;
-
/** WIFI_SCAN_REQ Command */
typedef struct
{
@@ -197,18 +190,39 @@
unsigned char ssid[SSID_MAX_LENGTH+1];
}tagWIFI_SCAN_REQ_T;
-
+ /** WIFI_GET_STATUS_REQ Command */
+ typedef struct
+ {
+ unsigned char cmd_sid;
+ unsigned char seq;
+ unsigned char interface;
+ }tagWIFI_GET_STATUS_REQ_T;
+
/** Get buffer for command from memory pool.
@return Pointer of buffer
*/
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *allocCmdBuf();
/** Release buffer to memory pool.
@param buf_p Pointer of buffer
*/
void freeCmdBuf( tagMEMPOOL_BLOCK_T *buf_p );
- /** Initialize UART
+ /** Get buffer for command from memory pool.
+ @return Pointer of buffer
+ */
+ tagMEMPOOL_BLOCK_T *allocUartRcvBuf();
+
+ /** Release buffer to memory pool.
+ @param buf_p Pointer of buffer
+ */
+ void freeUartRecvBuf( tagMEMPOOL_BLOCK_T *buf_p );
+
+ /** Module Reset
+ */
+ int resetModule( PinName reset );
+
+/** Initialize UART
*/
int initUart( PinName tx, PinName rx, int baud );
@@ -245,6 +259,8 @@
*/
C_SNIC_UartCommandManager *getUartCommand();
+ unsigned char *getCommandBuf();
+
/** Get an instance of the C_SNIC_Core class.
@return Instance of the C_SNIC_Core class
@note Please do not create an instance in the default constructor this class.
@@ -255,14 +271,15 @@
private:
static C_SNIC_Core *mInstance_p;
Thread *mUartRecvThread_p;
+ Thread *mUartRecvDispatchThread_p;
RawSerial *mUart_p;
Mutex mUartMutex;
+
// DigitalInOut mModuleReset;
C_SNIC_UartCommandManager *mUartCommand_p;
-
- /** MemoryPool for payload of UART response */
- MemoryPool<tagMEMPOOL_BLOCK_T, MEMPOOL_PAYLOAD_NUM> mMemPoolPayload;
-
+
+ CircBuffer<char> *mUartRecvBuf_p; // UART RecvBuffer
+
/** Socket buffer */
tagCONNECT_INFO_T mConnectInfo[MAX_SOCKET_ID+1];
@@ -271,10 +288,11 @@
C_SNIC_Core();
virtual ~C_SNIC_Core();
+
+ static void uartRecvCallback( void );
/** Receiving thread of UART
*/
- static void uartRecvThread( void const *args_p );
+ static void uartRecvDispatchThread( void const *args_p );
};
-}
#endif
\ No newline at end of file
--- a/SNIC/SNIC_UartCommandManager.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC/SNIC_UartCommandManager.cpp Mon May 26 05:17:28 2014 +0000
@@ -14,8 +14,6 @@
#include "SNIC_UartCommandManager.h"
#include "SNIC_Core.h"
-using namespace murata_wifi;
-
C_SNIC_UartCommandManager::~C_SNIC_UartCommandManager()
{
}
--- a/SNIC/SNIC_UartCommandManager.h Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC/SNIC_UartCommandManager.h Mon May 26 05:17:28 2014 +0000
@@ -17,8 +17,6 @@
#include "mbed.h"
#include "rtos.h"
-namespace murata_wifi
-{
/** Max length of SSID */
#define SSID_MAX_LENGTH 32
/** Max length of BSSID */
@@ -138,5 +136,4 @@
void (*mScanResultHandler_p)(tagSCAN_RESULT_T *scan_result);
};
-}
#endif
--- a/SNIC/SNIC_UartMsgUtil.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC/SNIC_UartMsgUtil.cpp Mon May 26 05:17:28 2014 +0000
@@ -13,8 +13,6 @@
* ***********************************************************************/
#include "SNIC_UartMsgUtil.h"
-using namespace murata_wifi;
-
C_SNIC_UartMsgUtil::C_SNIC_UartMsgUtil()
{
}
--- a/SNIC/SNIC_UartMsgUtil.h Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC/SNIC_UartMsgUtil.h Mon May 26 05:17:28 2014 +0000
@@ -18,9 +18,6 @@
#include "rtos.h"
#include "RawSerial.h"
-namespace murata_wifi
-{
-
#define UART_CMD_SOM 0x02
#define UART_CMD_EOM 0x04
#define UART_CMD_ESC 0x10
@@ -170,5 +167,5 @@
protected:
};
-}
+
#endif /* _YD_WIFI_UART_MSG_H_ */
\ No newline at end of file
--- a/SNIC_WifiInterface.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC_WifiInterface.cpp Mon May 26 05:17:28 2014 +0000
@@ -13,7 +13,6 @@
#include "SNIC_WifiInterface.h"
#include "SNIC_UartMsgUtil.h"
-using namespace murata_wifi;
C_SNIC_WifiInterface::C_SNIC_WifiInterface( PinName tx, PinName rx, PinName cts, PinName rts, PinName reset, PinName alarm, int baud)
{
@@ -34,12 +33,15 @@
C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance();
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
+ /* Module reset */
+ snic_core_p->resetModule( mModuleReset );
+
/* Initialize UART */
snic_core_p->initUart( mUART_tx, mUART_rx, mUART_baud );
/* Initialize SNIC API */
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("snic_init payload_buf NULL\r\n");
@@ -53,7 +55,7 @@
req.buf_size[0] = 0x08;
req.buf_size[1] = 0x00;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_SNIC, req.cmd_sid, (unsigned char *)&req
@@ -88,7 +90,7 @@
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("getFWVersion payload_buf NULL\r\n");
@@ -100,7 +102,7 @@
req.cmd_sid = UART_CMD_SID_GEN_FW_VER_GET_REQ;
req.seq = mUartRequestSeq++;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_GEN, req.cmd_sid, (unsigned char *)&req
@@ -129,6 +131,7 @@
return 0;
}
+unsigned char gCONNECT_BUF[UART_REQUEST_PAYLOAD_MAX];
int C_SNIC_WifiInterface::connect(const char *ssid_p, unsigned char ssid_len, E_SECURITY sec_type
, const char *sec_key_p, unsigned char sec_key_len)
{
@@ -150,16 +153,15 @@
}
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("connect payload_buf NULL\r\n");
return -1;
}
- unsigned char buf[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *buf = &gCONNECT_BUF[0];
unsigned int buf_len = 0;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
unsigned int command_len;
memset( buf, 0, UART_REQUEST_PAYLOAD_MAX );
@@ -189,6 +191,7 @@
}
}
+ unsigned char *command_array = snic_core_p->getCommandBuf();
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_WIFI, UART_CMD_SID_WIFI_JOIN_REQ, buf
, buf_len, payload_buf->buf, command_array );
@@ -205,8 +208,10 @@
snic_core_p->freeCmdBuf( payload_buf );
return -1;
}
+ printf("join OK\r\n");
- if( uartCmdMgr_p->getCommandStatus() != 0 )
+ if( (uartCmdMgr_p->getCommandStatus() != 0) &&
+ (uartCmdMgr_p->getCommandStatus() != UART_CMD_RES_WIFI_ERR_ALREADY_JOINED) )
{
printf("join status:%02x\r\n", uartCmdMgr_p->getCommandStatus());
ret = -1;
@@ -222,7 +227,7 @@
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("disconnect payload_buf NULL\r\n");
@@ -234,7 +239,7 @@
req.cmd_sid = UART_CMD_SID_WIFI_DISCONNECT_REQ;
req.seq = mUartRequestSeq++;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
@@ -269,7 +274,7 @@
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("scan payload_buf NULL\r\n");
@@ -309,7 +314,7 @@
}
buf_len++;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
@@ -356,7 +361,7 @@
}
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("wifi_on payload_buf NULL\r\n");
@@ -369,7 +374,7 @@
req.seq = mUartRequestSeq++;
memcpy( req.country, country_p, COUNTRYC_CODE_LENTH );
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
@@ -404,7 +409,7 @@
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("wifi_off payload_buf NULL\r\n");
@@ -416,7 +421,7 @@
req.cmd_sid = UART_CMD_SID_WIFI_OFF_REQ;
req.seq = mUartRequestSeq++;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
@@ -456,7 +461,7 @@
}
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("getRssi payload_buf NULL\r\n");
@@ -469,7 +474,7 @@
req.cmd_sid = UART_CMD_SID_WIFI_GET_STA_RSSI_REQ;
req.seq = mUartRequestSeq++;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
, sizeof(C_SNIC_Core::tagWIFI_GET_STA_RSSI_REQ_T), payload_buf->buf, command_array );
@@ -505,7 +510,7 @@
}
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("getWifiStatus payload_buf NULL\r\n");
@@ -518,7 +523,7 @@
req.seq = mUartRequestSeq++;
req.interface = 0;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
, sizeof(C_SNIC_Core::tagWIFI_GET_STATUS_REQ_T), payload_buf->buf, command_array );
--- a/SNIC_WifiInterface.h Tue Apr 01 07:19:19 2014 +0000
+++ b/SNIC_WifiInterface.h Mon May 26 05:17:28 2014 +0000
@@ -16,9 +16,6 @@
#include "SNIC_Core.h"
#include "MurataObject.h"
-namespace murata_wifi
-{
-
/** Wi-Fi status used by getWifiStatus(). */
typedef struct
{
@@ -154,5 +151,4 @@
int mUART_baud;
PinName mModuleReset;
};
-}
#endif /* _YD_WIFIINTERFACE_H_ */
\ No newline at end of file
--- a/Socket/Endpoint.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/Endpoint.cpp Mon May 26 05:17:28 2014 +0000
@@ -32,8 +32,6 @@
#include <cstring>
#include <cstdio>
-using namespace murata_wifi;
-
Endpoint::Endpoint()
{
reset_address();
--- a/Socket/Endpoint.h Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/Endpoint.h Mon May 26 05:17:28 2014 +0000
@@ -30,9 +30,6 @@
#ifndef ENDPOINT_H
#define ENDPOINT_H
-namespace murata_wifi
-{
-
class UDPSocket;
/**
@@ -74,5 +71,4 @@
// struct sockaddr_in _remoteHost;
};
-}
#endif
--- a/Socket/Socket.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/Socket.cpp Mon May 26 05:17:28 2014 +0000
@@ -30,13 +30,16 @@
#include "Socket.h"
#include <cstring>
-using namespace murata_wifi;
-
Socket::Socket()
{
mSocketID = -1;
}
+void Socket::set_blocking(bool blocking, unsigned int timeout) {
+ _blocking = blocking;
+ _timeout = timeout;
+}
+
Socket::~Socket() {
// close(); //Don't want to leak
}
@@ -54,7 +57,7 @@
C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance();
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("socket close payload_buf NULL\r\n");
@@ -68,7 +71,7 @@
req.seq = mUartRequestSeq++;
req.socket_id = mSocketID;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_SNIC, req.cmd_sid, (unsigned char *)&req
@@ -110,7 +113,7 @@
C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance();
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("createSocket payload_buf NULL\r\n");
@@ -137,12 +140,11 @@
*/
}
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_SNIC, req.cmd_sid, (unsigned char *)&req
, req_len, payload_buf->buf, command_array );
-
// Send uart command request
snic_core_p->sendUart( command_len, command_array );
@@ -155,7 +157,7 @@
snic_core_p->freeCmdBuf( payload_buf );
return -1;
}
-
+
if( uartCmdMgr_p->getCommandStatus() != 0 )
{
printf("createSocket status:%02x\r\n", uartCmdMgr_p->getCommandStatus());
@@ -208,3 +210,75 @@
return addr;
}
+
+int Socket::resolveHostName( const char *host_p )
+{
+ C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance();
+ C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
+ int ip_addr = 0;
+
+ if( host_p == NULL )
+ {
+ printf("resolveHostName parameter error\r\n");
+ return -1;
+ }
+
+ // Get buffer for response payload from MemoryPool
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ if( payload_buf == NULL )
+ {
+ printf("resolveHostName payload_buf NULL\r\n");
+ return -1;
+ }
+
+ unsigned char buf[UART_REQUEST_PAYLOAD_MAX];
+ unsigned int buf_len = 0;
+
+ memset( buf, 0, UART_REQUEST_PAYLOAD_MAX );
+ // Make request
+ buf[0] = UART_CMD_SID_SNIC_RESOLVE_NAME_REQ;
+ buf_len++;
+ buf[1] = mUartRequestSeq++;
+ buf_len++;
+ // Interface
+ buf[2] = 0;
+ buf_len++;
+
+ // Host name length
+ int hostname_len = strlen(host_p);
+ buf[3] = (unsigned char)hostname_len;
+ buf_len++;
+ memcpy( &buf[4], host_p, hostname_len );
+ buf_len += hostname_len;
+
+ unsigned char *command_array = snic_core_p->getCommandBuf();
+ unsigned int command_len;
+ command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_SNIC, UART_CMD_SID_SNIC_RESOLVE_NAME_REQ, buf
+ , buf_len, payload_buf->buf, command_array );
+
+ // Send uart command request
+ snic_core_p->sendUart( command_len, command_array );
+
+ int ret;
+ // Wait UART response
+ ret = uartCmdMgr_p->wait();
+ if( ret != 0 )
+ {
+ printf( "resolveHostName failed\r\n" );
+ snic_core_p->freeCmdBuf( payload_buf );
+ return -1;
+ }
+
+ // check status
+ if( uartCmdMgr_p->getCommandStatus() == 0 )
+ {
+ ip_addr = ((payload_buf->buf[3] << 24) & 0xFF000000)
+ | ((payload_buf->buf[4] << 16) & 0xFF0000)
+ | ((payload_buf->buf[5] << 8) & 0xFF00)
+ | (payload_buf->buf[6]);
+ }
+
+ snic_core_p->freeCmdBuf( payload_buf );
+
+ return ip_addr;
+}
--- a/Socket/Socket.h Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/Socket.h Mon May 26 05:17:28 2014 +0000
@@ -30,25 +30,28 @@
#ifndef SOCKET_H_
#define SOCKET_H_
-#include "MurataObject.h"
#include "SNIC_Core.h"
#include "SNIC_UartMsgUtil.h"
typedef unsigned long socklen_t;
-namespace murata_wifi
-{
-
#define SNIC_UART_RECVBUF_SIZE 2048
/** Socket file descriptor and select wrapper
*/
-class Socket: public C_MurataObject {
+class Socket {
public:
/** Socket
*/
Socket();
+ /** Set blocking or non-blocking mode of the socket and a timeout on
+ blocking socket operations
+ \param blocking true for blocking mode, false for non-blocking mode.
+ \param timeout timeout in ms [Default: (1500)ms].
+ */
+ void set_blocking(bool blocking, unsigned int timeout=1500);
+
/** Set socket options
@param level stack level (see: lwip/sockets.h)
@param optname option ID
@@ -79,11 +82,13 @@
protected:
int addrToInteger( const char *addr_p );
+ int resolveHostName( const char *host_p );
+
protected:
- int mSocketID;
-#if 0
+ int mSocketID;
bool _blocking;
int _timeout;
+#if 0
GSwifi * _wifi;
bool _server;
@@ -95,6 +100,5 @@
// int select(struct timeval *timeout, bool read, bool write);
};
-}
#endif /* SOCKET_H_ */
--- a/Socket/TCPSocketConnection.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/TCPSocketConnection.cpp Mon May 26 05:17:28 2014 +0000
@@ -30,8 +30,6 @@
#include "TCPSocketConnection.h"
#include <cstring>
-using namespace murata_wifi;
-
TCPSocketConnection::TCPSocketConnection()
{
}
@@ -40,12 +38,12 @@
{
}
-int TCPSocketConnection::connect( const char *ip_addr_p, unsigned short port)
+int TCPSocketConnection::connect( const char *host_p, unsigned short port)
{
int ret;
C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance();
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
-
+
// Socket create
ret = createSocket();
if( ret != 0 )
@@ -53,19 +51,28 @@
printf("createSocket error : %d\r\n", ret);
return -1;
}
+ printf("socket created : %d\r\n", mSocketID);
+ int ip_addr = resolveHostName( host_p );
+ lcd_printf("connect to [%s](%08x)\r\n", host_p, ip_addr);
+ if( ( ip_addr == 0) || (ip_addr == -1) )
+ {
+ printf("connect resolveHostName failed\r\n");
+ return -1;
+ }
+
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
- printf("connect payload_buf NULL\r\n");
+ lcd_printf("connect payload_buf NULL\r\n");
return -1;
}
-
+
// IP address convert to number from strings.
- unsigned int ip_addr = addrToInteger(ip_addr_p);
- printf("connect to [%s](%08x)\r\n", ip_addr_p, ip_addr);
+// unsigned int ip_addr = addrToInteger(ip_addr_p);
+ //
C_SNIC_Core::tagSNIC_TCP_CONNECT_TO_SERVER_REQ_T req;
// Make request
req.cmd_sid = UART_CMD_SID_SNIC_TCP_CONNECT_TO_SERVER_REQ;
@@ -73,27 +80,33 @@
req.socket_id = mSocketID;
// set ip addr ( byte order )
- req.remote_addr[0] = ( (ip_addr & 0xFF000000) >> 24 );
- req.remote_addr[1] = ( (ip_addr & 0xFF0000) >> 16 );
- req.remote_addr[2] = ( (ip_addr & 0xFF00) >> 8 );
- req.remote_addr[3] = (ip_addr & 0xFF);
+ req.remote_addr[0] = ((ip_addr & 0xFF000000) >> 24 );
+ req.remote_addr[1] = ((ip_addr & 0xFF0000) >> 16 );
+ req.remote_addr[2] = ((ip_addr & 0xFF00) >> 8 );
+ req.remote_addr[3] = ( ip_addr & 0xFF);
+/*
+ req.remote_addr[0] = 0xD8;
+ req.remote_addr[1] = 0x34;
+ req.remote_addr[2] = 0xE9;
+ req.remote_addr[3] = 0x78;
+*/
req.remote_port[0] = ( (port & 0xFF00) >> 8 );
req.remote_port[1] = (port & 0xFF);
req.recv_bufsize[0] = ( (SNIC_UART_RECVBUF_SIZE & 0xFF00) >> 8 );
req.recv_bufsize[1] = (SNIC_UART_RECVBUF_SIZE & 0xFF);
req.timeout = 60;
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
+ unsigned char *command_array = snic_core_p->getCommandBuf();
unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_SNIC, req.cmd_sid, (unsigned char *)&req
, sizeof(C_SNIC_Core::tagSNIC_TCP_CONNECT_TO_SERVER_REQ_T), payload_buf->buf, command_array );
+ uartCmdMgr_p->setCommandSID( UART_CMD_SID_SNIC_TCP_CONNECTION_STATUS_IND );
+
// Send uart command request
snic_core_p->sendUart( command_len, command_array );
- uartCmdMgr_p->setCommandSID( UART_CMD_SID_SNIC_TCP_CONNECTION_STATUS_IND );
-
// Wait UART response
ret = uartCmdMgr_p->wait();
if( ret != 0 )
@@ -109,6 +122,7 @@
snic_core_p->freeCmdBuf( payload_buf );
return -1;
}
+
snic_core_p->freeCmdBuf( payload_buf );
// Initialize connection information
@@ -116,11 +130,11 @@
if( con_info_p->recvbuf_p == NULL )
{
printf( "create recv buffer[socket:%d]\r\n", mSocketID);
- con_info_p->recvbuf_p = new CircBuffer<unsigned char>(SNIC_UART_RECVBUF_SIZE);
+ con_info_p->recvbuf_p = new CircBuffer<char>(SNIC_UART_RECVBUF_SIZE);
}
con_info_p->is_connected = true;
con_info_p->is_received = false;
-
+
return 0;
}
@@ -132,19 +146,19 @@
}
unsigned char gTCP_SEND_BUF[2048];
-int TCPSocketConnection::send(unsigned char* data_p, int length)
+int TCPSocketConnection::send(char* data_p, int length)
{
C_SNIC_Core *snic_core_p = C_SNIC_Core::getInstance();
C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
// Get buffer for response payload from MemoryPool
- C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
+ tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
if( payload_buf == NULL )
{
printf("connect payload_buf NULL\r\n");
return -1;
}
-
+
C_SNIC_Core::tagSNIC_TCP_SEND_FROM_SOCKET_REQ_T req;
// Make request
req.cmd_sid = UART_CMD_SID_SNIC_SEND_FROM_SOCKET_REQ;
@@ -158,8 +172,8 @@
memcpy( gTCP_SEND_BUF, &req, req_size );
memcpy( &gTCP_SEND_BUF[req_size], data_p, length );
- unsigned char command_array[UART_REQUEST_PAYLOAD_MAX];
- unsigned int command_len;
+ unsigned char *command_array = snic_core_p->getCommandBuf();
+ unsigned int command_len;
// Preparation of command
command_len = snic_core_p->preparationSendCommand( UART_CMD_ID_SNIC, req.cmd_sid, gTCP_SEND_BUF
, req_size + length, payload_buf->buf, command_array );
@@ -188,7 +202,12 @@
return 0;
}
-int TCPSocketConnection::receive(unsigned char* data_p, int length)
+int TCPSocketConnection::send_all(char *data_p, int length)
+{
+ return send( data_p, length );
+}
+
+int TCPSocketConnection::receive(char* data_p, int length)
{
int i = 0;
--- a/Socket/TCPSocketConnection.h Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/TCPSocketConnection.h Mon May 26 05:17:28 2014 +0000
@@ -31,13 +31,9 @@
#ifndef TCPSOCKET_H
#define TCPSOCKET_H
-#include "MurataObject.h"
#include "Socket.h"
#include "Endpoint.h"
-namespace murata_wifi
-{
-
/**
Interface class for TCP socket of using SNIC UART.
*/
@@ -68,17 +64,23 @@
@param length The length of the buffer to send.
@return the number of written bytes on success (>=0) or -1 on failure
*/
- int send(unsigned char *data_p, int length);
+ int send(char *data_p, int length);
+
+ /** Send data to the remote host.
+ @param data The buffer to send to the host.
+ @param length The length of the buffer to send.
+ @return the number of written bytes on success (>=0) or -1 on failure
+ */
+ int send_all(char *data_p, int length);
/** Receive data from the remote host.
@param data The buffer in which to store the data received from the host.
@param length The maximum length of the buffer.
@return the number of received bytes on success (>=0) or -1 on failure
*/
- int receive(unsigned char *data_p, int length);
+ int receive(char *data_p, int length);
private:
};
-}
#endif
--- a/Socket/TCPSocketServer.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/TCPSocketServer.cpp Mon May 26 05:17:28 2014 +0000
@@ -31,8 +31,6 @@
#include <cstring>
-using namespace murata_wifi;
-
TCPSocketServer::TCPSocketServer()
{
}
--- a/Socket/TCPSocketServer.h Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/TCPSocketServer.h Mon May 26 05:17:28 2014 +0000
@@ -30,13 +30,9 @@
#ifndef TCPSOCKETSERVER_H
#define TCPSOCKETSERVER_H
-#include "MurataObject.h"
#include "Socket.h"
#include "TCPSocketConnection.h"
-namespace murata_wifi
-{
-
/**
Interface class for TCP server socket of using SNIC UART.
@@ -67,6 +63,5 @@
*/
int accept(TCPSocketConnection& connection);
};
-}
#endif
--- a/Socket/UDPSocket.cpp Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/UDPSocket.cpp Mon May 26 05:17:28 2014 +0000
@@ -32,8 +32,6 @@
#include <cstring>
-using namespace murata_wifi;
-
UDPSocket::UDPSocket() {
}
--- a/Socket/UDPSocket.h Tue Apr 01 07:19:19 2014 +0000
+++ b/Socket/UDPSocket.h Mon May 26 05:17:28 2014 +0000
@@ -31,13 +31,9 @@
#ifndef UDPSOCKET_H
#define UDPSOCKET_H
-#include "MurataObject.h"
#include "Socket.h"
#include "Endpoint.h"
-namespace murata_wifi
-{
-
/**
Interface class for UDP socket of using SNIC UART.
*/
@@ -77,6 +73,5 @@
*/
int receiveFrom(Endpoint &remote, char *buffer, int length);
};
-}
#endif
--- a/mbed-rtos.lib Tue Apr 01 07:19:19 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#f88660a9bed1
ban4jp -
