Murata RF modules are designed to simplify wireless development and certification by minimizing the amount of RF expertise you need to wirelessly enable a wide range of applications.

Files at this revision

API Documentation at this revision

Comitter:
yangcq88517
Date:
Tue Feb 03 21:24:15 2015 +0000
Child:
1:fd19bd683e90
Commit message:
MuRata WiFi Module

Changed in this revision

Config/DHCPConfig.cpp Show annotated file Show diff for this revision Revisions of this file
Config/DHCPConfig.h Show annotated file Show diff for this revision Revisions of this file
Config/IConfig.h Show annotated file Show diff for this revision Revisions of this file
Config/SoftAPConfig.cpp Show annotated file Show diff for this revision Revisions of this file
Config/SoftAPConfig.h Show annotated file Show diff for this revision Revisions of this file
Config/UARTConfig.cpp Show annotated file Show diff for this revision Revisions of this file
Config/UARTConfig.h Show annotated file Show diff for this revision Revisions of this file
ErrorCode/CMDCode.h Show annotated file Show diff for this revision Revisions of this file
ErrorCode/SNICCode.h Show annotated file Show diff for this revision Revisions of this file
ErrorCode/WIFICode.h Show annotated file Show diff for this revision Revisions of this file
Indication/HTTPResponseIndication.cpp Show annotated file Show diff for this revision Revisions of this file
Indication/HTTPResponseIndication.h Show annotated file Show diff for this revision Revisions of this file
Indication/PowerUpIndication.cpp Show annotated file Show diff for this revision Revisions of this file
Indication/PowerUpIndication.h Show annotated file Show diff for this revision Revisions of this file
Indication/SSIDRecordIndication.cpp Show annotated file Show diff for this revision Revisions of this file
Indication/SSIDRecordIndication.h Show annotated file Show diff for this revision Revisions of this file
Indication/SocketReceiveInidcation.cpp Show annotated file Show diff for this revision Revisions of this file
Indication/SocketReceiveInidcation.h Show annotated file Show diff for this revision Revisions of this file
Indication/TCPStatusIndication.cpp Show annotated file Show diff for this revision Revisions of this file
Indication/TCPStatusIndication.h Show annotated file Show diff for this revision Revisions of this file
Indication/UDPReceivedIndication.cpp Show annotated file Show diff for this revision Revisions of this file
Indication/UDPReceivedIndication.h Show annotated file Show diff for this revision Revisions of this file
Indication/WIFIConnectionIndication.cpp Show annotated file Show diff for this revision Revisions of this file
Indication/WIFIConnectionIndication.h Show annotated file Show diff for this revision Revisions of this file
MuRata.cpp Show annotated file Show diff for this revision Revisions of this file
MuRata.h Show annotated file Show diff for this revision Revisions of this file
Payload.cpp Show annotated file Show diff for this revision Revisions of this file
Payload.h Show annotated file Show diff for this revision Revisions of this file
Response/CreateSocketResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/CreateSocketResponse.h Show annotated file Show diff for this revision Revisions of this file
Response/DHCPInfoResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/DHCPInfoResponse.h Show annotated file Show diff for this revision Revisions of this file
Response/HTTPResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/HTTPResponse.h Show annotated file Show diff for this revision Revisions of this file
Response/InitializationResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/InitializationResponse.h Show annotated file Show diff for this revision Revisions of this file
Response/SendFromSocketResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/SendFromSocketResponse.h Show annotated file Show diff for this revision Revisions of this file
Response/SocketStartReceiveResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/SocketStartReceiveResponse.h Show annotated file Show diff for this revision Revisions of this file
Response/VersionInfoResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/VersionInfoResponse.h Show annotated file Show diff for this revision Revisions of this file
Response/WIFIStatusResponse.cpp Show annotated file Show diff for this revision Revisions of this file
Response/WIFIStatusResponse.h Show annotated file Show diff for this revision Revisions of this file
Type/BSSType.h Show annotated file Show diff for this revision Revisions of this file
Type/CommandID.h Show annotated file Show diff for this revision Revisions of this file
Type/DHCPMode.h Show annotated file Show diff for this revision Revisions of this file
Type/HTTPContent.cpp Show annotated file Show diff for this revision Revisions of this file
Type/HTTPContent.h Show annotated file Show diff for this revision Revisions of this file
Type/HTTPMethod.h Show annotated file Show diff for this revision Revisions of this file
Type/IPAddress.cpp Show annotated file Show diff for this revision Revisions of this file
Type/IPAddress.h Show annotated file Show diff for this revision Revisions of this file
Type/ResetCode.h Show annotated file Show diff for this revision Revisions of this file
Type/ResponseFlag.h Show annotated file Show diff for this revision Revisions of this file
Type/ScanType.h Show annotated file Show diff for this revision Revisions of this file
Type/SecurityMode.h Show annotated file Show diff for this revision Revisions of this file
Type/SocketSentOption.h Show annotated file Show diff for this revision Revisions of this file
Type/SubCommandID.h Show annotated file Show diff for this revision Revisions of this file
Type/WIFIInfo.cpp Show annotated file Show diff for this revision Revisions of this file
Type/WIFIInfo.h Show annotated file Show diff for this revision Revisions of this file
Type/WIFIInterface.h Show annotated file Show diff for this revision Revisions of this file
Type/WIFINetwork.cpp Show annotated file Show diff for this revision Revisions of this file
Type/WIFINetwork.h Show annotated file Show diff for this revision Revisions of this file
Type/WIFINetworkDetail.cpp Show annotated file Show diff for this revision Revisions of this file
Type/WIFINetworkDetail.h Show annotated file Show diff for this revision Revisions of this file
Type/WIFIStatusCode.h Show annotated file Show diff for this revision Revisions of this file
Type/WPSMode.h Show annotated file Show diff for this revision Revisions of this file
UARTFrame.cpp Show annotated file Show diff for this revision Revisions of this file
UARTFrame.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config/DHCPConfig.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,96 @@
+#include "DHCPConfig.h"
+
+using namespace SmartLabMuRata;
+
+DHCPConfig::DHCPConfig(const WIFIInterface wifiInterface, const DHCPMode mode)
+{
+    ip = NULL;
+    mask = NULL;
+    gateway = NULL;
+    first = NULL;
+    last = NULL;
+    SetDHCPMode(mode).SetInterface(wifiInterface);
+}
+
+/*
+DHCPConfig::~DHCPConfig()
+{
+    delete ip;
+    delete mask;
+    delete gateway;
+    delete first;
+    delete last;
+}
+*/
+
+WIFIInterface DHCPConfig::GetInterface()
+{
+    return _interface;
+}
+
+DHCPMode DHCPConfig::GetDHCPMode()
+{
+    return mode;
+}
+
+IPAddress * DHCPConfig::GetLocalIP()
+{
+    return ip;
+}
+
+IPAddress * DHCPConfig::GetNetmask()
+{
+    return mask;
+}
+
+IPAddress * DHCPConfig::GetGatewayIP()
+{
+    return gateway;
+}
+
+IPAddress * DHCPConfig::GetIPRangeFirst()
+{
+    return first;
+}
+
+IPAddress * DHCPConfig::GetIPRangeLast()
+{
+    return last;
+}
+
+DHCPConfig & DHCPConfig::SetInterface(const WIFIInterface wifiInterface)
+{
+    _interface = wifiInterface;
+    return *this;
+}
+
+DHCPConfig & DHCPConfig::SetDHCPMode(const DHCPMode mode)
+{
+    this->mode = mode;
+    return *this;
+}
+
+DHCPConfig & DHCPConfig::SetLocalIP(const char * ip)
+{
+    this->ip = new IPAddress(ip);
+    return *this;
+}
+
+DHCPConfig & DHCPConfig::SetNetmask(const char * netmask)
+{
+    mask = new IPAddress(netmask);
+    return *this;
+}
+
+DHCPConfig & DHCPConfig::SetGatewayIP(const char * gateway)
+{
+    this->gateway = new IPAddress(gateway);
+    return *this;
+}
+
+DHCPConfig & DHCPConfig::SetIPRange(const char * first, const char * last)
+{
+    this->first = new IPAddress(first);
+    this->last = new IPAddress(last);
+    return *this;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config/DHCPConfig.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,62 @@
+#ifndef SmartLab_MuRata_Config_DHCPConfig
+#define SmartLab_MuRata_Config_DHCPConfig
+
+#include "WIFIInterface.h"
+#include "DHCPMode.h"
+#include "IPAddress.h"
+
+namespace SmartLabMuRata
+{
+class DHCPConfig
+{
+    /*
+     * 0: interface is assigned the static IP, NetMask and Gateway IP. First IP and Last IP are not present. Any active DHCP client or server is stopped.
+     * 1: STA interface uses DHCP to obtain the address. All subsequent fields are not present. STA DHCP client is started if necessary.
+     * 2: only for AP interface. If the soft AP is not started or SNIC_INIT_REQ is not done, this command fails. Otherwise, this command stops the HTTP server, DNS server and DHCP server if configured, and restarts them with new parameters. It assigns IP for clients in range [First IP, Last IP] within the subnet mask. The AP itself is assigned the address within the same subnet specified by IP which must not be in the range of [First IP, Last IP]. The value of GTW IP and IP should be the same. If there are clients connected to the soft AP before this command, make sure the clients reconnect to the soft AP after this command.
+     */
+
+private :
+    WIFIInterface _interface;
+    DHCPMode mode;
+
+    IPAddress * ip;
+    IPAddress * mask;
+    IPAddress * gateway;
+    IPAddress * first;
+    IPAddress * last;
+
+public :
+
+    DHCPConfig(const WIFIInterface wifiInterface, const DHCPMode mode);
+
+    //~DHCPConfig();
+
+    WIFIInterface GetInterface();
+
+    DHCPMode GetDHCPMode();
+
+    IPAddress * GetLocalIP();
+
+    IPAddress * GetNetmask();
+
+    IPAddress * GetGatewayIP();
+
+    IPAddress * GetIPRangeFirst();
+
+    IPAddress * GetIPRangeLast();
+
+    DHCPConfig & SetInterface(const WIFIInterface wifiInterface);
+
+    DHCPConfig & SetDHCPMode(const DHCPMode mode);
+
+    DHCPConfig & SetLocalIP(const char * ip);
+
+    DHCPConfig & SetNetmask(const char * netmask);
+
+    DHCPConfig & SetGatewayIP(const char * gateway);
+
+    DHCPConfig & SetIPRange(const char *  first, const char *  last);
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config/IConfig.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,13 @@
+#ifndef SmartLab_MuRata_Config_IConfig
+#define SmartLab_MuRata_Config_IConfig
+
+namespace SmartLabMuRata
+{
+class IConfig
+{
+    virtual const char * GetValue() = 0;
+    virtual int GetValueLength() = 0;
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config/SoftAPConfig.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,70 @@
+#include "SoftAPConfig.h"
+
+using namespace SmartLabMuRata;
+
+SoftAPConfig::SoftAPConfig(const State state, const char * SSID, const SecurityMode securityMode, const char * securityKey)
+    : WIFINetwork(SSID, securityMode, securityKey)
+{
+    SetOnOffState(state);
+}
+
+char SoftAPConfig::GetOnOffStatus()
+{
+    return onOff;
+}
+
+char SoftAPConfig::GetPersistency()
+{
+    return persistency ? 0x01 : 0x00;
+}
+
+SoftAPConfig * SoftAPConfig::SetOnOffState(const State onOff)
+{
+    this->onOff = onOff;
+    return this;
+}
+
+SoftAPConfig * SoftAPConfig::SetPersistency(const bool persistency)
+{
+    this->persistency = persistency;
+    return this;
+}
+
+SoftAPConfig * SoftAPConfig::SetSecurityKey(const char * SecurityKey)
+{
+    WIFINetwork::SetSecurityKey(SecurityKey);
+    return this;
+}
+
+SoftAPConfig * SoftAPConfig::SetBSSID(const char * BSSID)
+{
+    WIFINetwork::SetBSSID(BSSID);
+    return this;
+}
+
+SoftAPConfig * SoftAPConfig::SetSSID(const char * SSID)
+{
+    WIFINetwork::SetSSID(SSID);
+    return this;
+}
+
+/// <summary>
+/// WIFI_SECURITY_OPEN
+/// WIFI_SECURITY_WPA_TKIP_PSK
+/// WIFI_SECURITY_WPA2_AES_PSK
+/// WIFI_SECURITY_WPA2_MIXED_PSK
+/// supported
+/// </summary>
+/// <param name="securityMode"></param>
+/// <returns></returns>
+SoftAPConfig * SoftAPConfig::SetSecurityMode(const SecurityMode securityMode)
+{
+    WIFINetwork::SetSecurityMode(securityMode);
+    return this;
+}
+
+SoftAPConfig * SoftAPConfig::SetChannel(const char  channel)
+{
+    WIFINetwork::SetChannel(channel);
+    return this;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config/SoftAPConfig.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,87 @@
+#ifndef SmartLab_MuRata_Config_SoftAPConfig
+#define SmartLab_MuRata_Config_SoftAPConfig
+
+#include "WIFINetwork.h"
+
+namespace SmartLabMuRata
+{
+class SoftAPConfig : public WIFINetwork
+{
+public :
+    enum State {
+        /// <summary>
+        /// indicates AP is to be turned off. The rest of the parameters are ignored.
+        /// </summary>
+        OFF = 0x00,
+
+        /// <summary>
+        /// indicates turning on soft AP using existing NVM parameters,
+        /// </summary>
+        ON_NVM = 0x01,
+
+        /// <summary>
+        /// indicates turning on AP with the parameters provided. If the soft AP is already on, it is first turned off.
+        /// </summary>
+        ON_PARAMETERS = 0x02,
+    };
+
+    SoftAPConfig(State state, const char * SSID = "", const SecurityMode securityMode = WIFI_SECURITY_OPEN, const char * securityKey = NULL);
+
+    char GetOnOffStatus();
+
+    char GetPersistency();
+
+    SoftAPConfig * SetOnOffState(const State onOff);
+
+    SoftAPConfig * SetPersistency(const bool persistency);
+
+    virtual SoftAPConfig * SetSecurityKey(const char * SecurityKey);
+
+    virtual SoftAPConfig * SetBSSID(const char * BSSID);
+
+    virtual SoftAPConfig * SetSSID(const char * SSID);
+
+    /// <summary>
+    /// WIFI_SECURITY_OPEN
+    /// WIFI_SECURITY_WPA_TKIP_PSK
+    /// WIFI_SECURITY_WPA2_AES_PSK
+    /// WIFI_SECURITY_WPA2_MIXED_PSK
+    /// supported
+    /// </summary>
+    /// <param name="securityMode"></param>
+    /// <returns></returns>
+    virtual SoftAPConfig * SetSecurityMode(const SecurityMode securityMode);
+
+    virtual SoftAPConfig * SetChannel(const char channel);
+    /*
+     * Parameters are as follows:
+     * UINT8 Request Sequence
+     * UINT8 Onoff
+     * UINT8 Persistency
+     * UINT8 SSID [up to 33]
+     * UINT8 Channel
+     * UINT8 Security mode
+     * UINT8 Security key length (0-64)
+     * … Security key [ ]
+     * OnOff = 0 indicates AP is to be turned off. The rest of the parameters are ignored.
+     * OnOff = 1 indicates turning on soft AP using existing NVM parameters,
+     * OnOff = 2 indicates turning on AP with the parameters provided. If the soft AP is already on, it is first turned off.
+     * Persistency=1 indicates the soft AP’s on/off state and parameters (if OnOff = 2) will be saved in NVM. For example, if OnOff =0 and Persistency=1, the soft AP will not be turned on after a reset.
+     */
+
+private :
+    State onOff;
+    bool persistency;
+
+    /// <summary>
+    /// OnOff = 0 indicates AP is to be turned off. The rest of the parameters are ignored.
+    /// BSSID is not required
+    /// !!! cannot be WEP and WIFI_SECURITY_WPA_AES_PSK !!!
+    /// </summary>
+    /// <param name="SSID">only required when OnOff = 2, which is ON_PARAMETERS</param>
+    /// <param name="securityMode"></param>
+    /// <param name="securityKey"></param>
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config/UARTConfig.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,45 @@
+#include "UARTConfig.h"
+
+using namespace SmartLabMuRata;
+
+const char * UARTConfig::GetValue()
+{
+    return value;
+}
+
+int UARTConfig::GetValueLength()
+{
+    return 6;
+}
+
+UARTConfig::UARTConfig(const FlowControl flowControl, const Parity parity, const StopBits StopBits, const BaudRate baudRate)
+{
+    SetFlowControl(flowControl)->SetParity(parity)->SetStopBits(StopBits)->SetBaudRate(baudRate);
+}
+
+UARTConfig * UARTConfig::SetFlowControl(const FlowControl flowControl)
+{
+    value[1] = value[1] & 0xDF | flowControl;
+    return this;
+}
+
+UARTConfig * UARTConfig::SetParity(const Parity parity)
+{
+    value[1] = value[1] & 0x3F | parity;
+    return this;
+}
+
+UARTConfig * UARTConfig::SetStopBits(const StopBits stop)
+{
+    value[1] = value[1] & 0xFC | stop;
+    return this;
+}
+
+UARTConfig * UARTConfig::SetBaudRate(const BaudRate baudRate)
+{
+    value[2] = baudRate >> 24;
+    value[3] = baudRate >> 16;
+    value[4] = baudRate >> 8;
+    value[5] = baudRate;
+    return this;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config/UARTConfig.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,46 @@
+#ifndef SmartLab_MuRata_Config_UARTConfig
+#define SmartLab_MuRata_Config_UARTConfig
+
+#include "IConfig.h"
+
+namespace SmartLabMuRata
+{
+class UARTConfig : public IConfig
+{
+    /*
+     * Parameters are as follows:
+     * UINT8 Request Sequence
+     * UINT8 Port
+     * UINT8 Format
+     * UINT32 Baud
+     * Port specifies the UART port. Valid value is 1.
+     */
+
+    //Data 0x10 8 data bits
+private :
+    char value[6];
+
+public:
+
+    enum FlowControl { NoFlowControl = 0x00, HardwareFlowControl = 0x20, };
+    enum Parity { None = 0x00, Odd = 0x40, Even = 0x80, };
+    enum StopBits { StopBit1 = 0x01, StopBit2 = 0x02, };
+    enum BaudRate { _9600 = 9600, _19200 = 19200, _38400 = 38400, _57600 = 57600, _115200 = 115200, _230400 = 230400, _460800 = 460800, _921600 = 921600 };
+
+    virtual const char * GetValue();
+
+    virtual int GetValueLength();
+
+    UARTConfig(const FlowControl flowControl, const Parity parity, const StopBits StopBits, const BaudRate baudRate);
+
+    UARTConfig * SetFlowControl(const FlowControl flowControl);
+
+    UARTConfig * SetParity(const Parity parity);
+
+    UARTConfig * SetStopBits(const StopBits stop);
+
+    UARTConfig * SetBaudRate(const BaudRate baudRate);
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ErrorCode/CMDCode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,13 @@
+#ifndef SmartLab_MuRata_ErrorCode_CMDCode
+#define SmartLab_MuRata_ErrorCode_CMDCode
+
+namespace SmartLabMuRata
+{
+enum CMDCode {
+    GEN_NORESPONSE = -1,
+    GEN_SUCCESS = 0x00,
+    GEN_FAILED = 0x01,
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ErrorCode/SNICCode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,42 @@
+#ifndef SmartLab_MuRata_ErrorCode_SNICCode
+#define SmartLab_MuRata_ErrorCode_SNICCode
+
+namespace SmartLabMuRata
+{
+enum SNICCode {
+    SNIC_NORESPONSE = -1,
+    SNIC_SUCCESS = 0x00,
+    SNIC_FAIL = 0x01,
+    SNIC_INIT_FAIL = 0x02,
+    SNIC_CLEANUP_FAIL = 0x03,
+    SNIC_GETADDRINFO_FAIL = 0x04,
+    SNIC_CREATE_SOCKET_FAIL = 0x05,
+    SNIC_BIND_SOCKET_FAIL = 0x06,
+    SNIC_LISTEN_SOCKET_FAIL = 0x07,
+    SNIC_ACCEPT_SOCKET_FAIL = 0x08,
+    SNIC_SOCKET_CLOSED = 0x0B,
+    SNIC_CLOSE_SOCKET_FAIL = 0x0C,
+    SNIC_PACKET_TOO_LARGE = 0x0D,
+    SNIC_SEND_FAIL = 0x0E,
+    SNIC_CONNECT_TO_SERVER_FAIL = 0x0F,
+    SNIC_NOT_ENOUGH_MEMORY = 0x10,
+    SNIC_TIMEOUT = 0x11,
+    SNIC_CONNECTION_UP = 0x12,
+    SNIC_GETSOCKOPT_FAIL = 0x13,
+    SNIC_SETSOCKOPT_FAIL = 0x14,
+    SNIC_INVALID_ARGUMENT = 0x15,
+    SNIC_SEND_ARP_FAIL = 0x16,
+    SNIC_INVALID_SOCKET = 0x17,
+    SNIC_COMMAND_PENDING = 0x18,
+    SNIC_SOCKET_NOT_BOUND = 0x19,
+    SNIC_SOCKET_NOT_CONNECTED = 0x1A,
+    SNIC_NO_NETWORK = 0x20,
+    SNIC_INIT_NOT_DONE = 0x21,
+    SNIC_NET_IF_FAIL = 0x22,
+    SNIC_NET_IF_NOT_UP = 0x23,
+    SNIC_DHCP_START_FAIL = 0x24,
+};
+}
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ErrorCode/WIFICode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,24 @@
+#ifndef SmartLab_MuRata_ErrorCode_WIFICode
+#define SmartLab_MuRata_ErrorCode_WIFICode
+
+namespace SmartLabMuRata
+{
+enum WIFICode {
+    WIFI_NORESPONSE = -1,
+    WIFI_SUCCESS = 0x00,
+    WIFI_ERR_UNKNOWN_COUNTRY = 0x01,
+    WIFI_ERR_INIT_FAIL = 0x02,
+    WIFI_ERR_ALREADY_JOINED = 0x03,
+    WIFI_ERR_AUTH_TYPE = 0x04,
+    WIFI_ERR_JOIN_FAIL = 0x05,
+    WIFI_ERR_NOT_JOINED = 0x06,
+    WIFI_ERR_LEAVE_FAILED = 0x07,
+    WIFI_COMMAND_PENDING = 0x08,
+    WIFI_WPS_NO_CONFIG = 0x09,
+    WIFI_NETWORK_UP = 0x10,
+    WIFI_NETWORK_DOWN = 0x11,
+    WIFI_FAIL = 0xFF,
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/HTTPResponseIndication.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,34 @@
+#include "HTTPResponseIndication.h"
+
+using namespace SmartLabMuRata;
+
+HTTPResponseIndication::HTTPResponseIndication(Payload * payload)
+    : Payload(payload)
+{
+    contentLength = (GetData()[2] & 0x7F) << 8 | GetData()[3];
+}
+
+bool HTTPResponseIndication::isMoreDataComing()
+{
+    return (GetData()[2] >> 7) == 0x01 ? true : false;
+}
+
+int HTTPResponseIndication::GetContentLength()
+{
+    return contentLength;
+}
+
+char HTTPResponseIndication::GetContent(int index)
+{
+    return GetData()[index + PAYLOAD_OFFSET];
+}
+
+const char * HTTPResponseIndication::GetContent()
+{
+    return GetData() + PAYLOAD_OFFSET;
+}
+
+int HTTPResponseIndication::GetContentOffset()
+{
+    return PAYLOAD_OFFSET;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/HTTPResponseIndication.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,42 @@
+#ifndef SmartLab_MuRata_Indication_HTTPResponseIndication
+#define SmartLab_MuRata_Indication_HTTPResponseIndication
+
+#include "Payload.h"
+
+namespace SmartLabMuRata
+{
+/// <summary>
+/// The most significant bit of Content length is reserved to indicate if there is more data to send to the host. When this bit is 1, the host application should continue to receive SNIC_HTTP_RSP_IND, until this bit is 0. The Content length is limited by the receive buffer size specified in SNIC_INIT_REQ and the system resource at that moment.
+/// </summary>
+class HTTPResponseIndication : public Payload
+{
+private :
+    int contentLength;
+
+    public :
+    
+    static const int PAYLOAD_OFFSET = 4;
+    
+    HTTPResponseIndication(Payload * payload);
+
+    /// <summary>
+    /// The most significant bit of Content length is reserved to indicate if there is more data to send to the host. When this bit is 1, the host application should continue to receive SNIC_HTTP_RSP_IND, until this bit is 0. The Content length is limited by the receive buffer size specified in SNIC_INIT_REQ and the system resource at that moment.
+    /// </summary>
+    /// <returns></returns>
+    bool isMoreDataComing();
+    
+    int GetContentLength();
+
+    char GetContent(int index);
+    
+    const char * GetContent();
+
+    /// <summary>
+    /// Get the start index of the content
+    /// </summary>
+    /// <returns></returns>
+    int GetContentOffset();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/PowerUpIndication.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,12 @@
+#include "PowerUpIndication.h"
+
+using namespace SmartLabMuRata;
+
+PowerUpIndication::PowerUpIndication(Payload * payload)
+    : Payload(payload)
+{ }
+
+ResetCode PowerUpIndication::GetResetCode()
+{
+    return (ResetCode)(GetData()[2] << 8 | GetData()[3]);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/PowerUpIndication.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,18 @@
+#ifndef SmartLab_MuRata_Indication_PowerUpIndication
+#define SmartLab_MuRata_Indication_PowerUpIndication
+
+#include "Payload.h"
+#include "ResetCode.h"
+
+namespace SmartLabMuRata
+{
+class PowerUpIndication : public Payload
+{
+public:
+    PowerUpIndication(Payload * payload);
+
+    ResetCode GetResetCode();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/SSIDRecordIndication.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,40 @@
+#include "SSIDRecordIndication.h"
+
+using namespace SmartLabMuRata;
+
+SSIDRecordIndication::SSIDRecordIndication(Payload * payload)
+    : Payload(payload)
+{}
+
+int SSIDRecordIndication::GetNumberofRecords()
+{
+    return GetData()[2];
+}
+
+void SSIDRecordIndication::GetRecords(WIFINetworkDetail * list)
+{
+    int count = GetNumberofRecords();
+
+    if (count <= 0)
+        return;
+
+    int index = 0;
+    int _position = 3;
+
+    const char * value = GetData();
+
+    while (index < count) {
+
+        list[index].SetChannel(value[_position++])
+        ->SetRSSI(value[_position++])
+        ->SetSecurityMode((SecurityMode)value[_position++])
+        ->SetBSSID(value + _position)
+        ->SetNetworkType((BSSType)value[_position += 6])
+        ->SetMaxDataRate(value[_position++])
+        ->SetSSID(value + (_position += 2));
+
+        _position+= list[index].GetSSID().length() + 1;
+
+        index++;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/SSIDRecordIndication.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,20 @@
+#ifndef SmartLab_MuRata_Indication_SSIDRecordIndication
+#define SmartLab_MuRata_Indication_SSIDRecordIndication
+
+#include "Payload.h"
+#include "WIFINetworkDetail.h"
+
+namespace SmartLabMuRata
+{
+class SSIDRecordIndication : public Payload
+{
+public:
+    SSIDRecordIndication(Payload * payload);
+
+    int GetNumberofRecords();
+
+    void GetRecords(WIFINetworkDetail * list);
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/SocketReceiveInidcation.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,34 @@
+#include "SocketReceiveInidcation.h"
+
+using namespace SmartLabMuRata;
+
+SocketReceiveInidcation::SocketReceiveInidcation(Payload * payload)
+    : Payload(payload)
+{
+    receiveLength = GetData()[3] << 8 | GetData()[4];
+}
+
+char SocketReceiveInidcation::GetServerSocketID()
+{
+    return GetData()[2];
+}
+
+int SocketReceiveInidcation::GetPayloadLength()
+{
+    return receiveLength;
+}
+
+char SocketReceiveInidcation::GetPayload(int index)
+{
+    return GetData()[index + PAYLOAD_OFFSET];
+}
+
+const char * SocketReceiveInidcation::GetPayload()
+{
+    return GetData() + PAYLOAD_OFFSET;
+}
+
+int SocketReceiveInidcation::GetPayloadOffset()
+{
+    return PAYLOAD_OFFSET;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/SocketReceiveInidcation.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,37 @@
+#ifndef SmartLab_MuRata_Indication_SocketReceiveInidcation
+#define SmartLab_MuRata_Indication_SocketReceiveInidcation
+
+#include "Payload.h"
+
+namespace SmartLabMuRata
+{
+/// <summary>
+/// This event is generated when a TCP server or a UDP server (in connected mode) receives a packet. Since there is no client address and port information, the application may need to call
+/// </summary>
+class SocketReceiveInidcation : public Payload
+{
+private:
+    int receiveLength;
+
+public:
+    static const int PAYLOAD_OFFSET = 5;
+
+    SocketReceiveInidcation(Payload * payload);
+
+    char GetServerSocketID() ;
+
+    int GetPayloadLength();
+
+    char GetPayload(int index);
+
+    const char * GetPayload();
+
+    /// <summary>
+    /// Get the start index of the payload
+    /// </summary>
+    /// <returns></returns>
+    int GetPayloadOffset();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/TCPStatusIndication.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,19 @@
+#include "TCPStatusIndication.h"
+
+using namespace SmartLabMuRata;
+
+TCPStatusIndication::TCPStatusIndication(Payload * payload)
+    : Payload(payload)
+{
+    socketID = GetData()[3];
+}
+
+SNICCode TCPStatusIndication::GetStatus()
+{
+    return (SNICCode)GetData()[2];
+}
+
+char TCPStatusIndication::GetSocketID()
+{
+    return socketID;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/TCPStatusIndication.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,23 @@
+#ifndef SmartLab_MuRata_Indication_TCPStatusIndication
+#define SmartLab_MuRata_Indication_TCPStatusIndication
+
+#include "Payload.h"
+#include "SNICCode.h"
+
+namespace SmartLabMuRata
+{
+class TCPStatusIndication : public Payload
+{
+private:
+    char socketID;
+
+public :
+    TCPStatusIndication(Payload * payload);
+
+    SNICCode GetStatus();
+
+    char GetSocketID();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/UDPReceivedIndication.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,46 @@
+#include "UDPReceivedIndication.h"
+
+using namespace SmartLabMuRata;
+
+UDPReceivedIndication::UDPReceivedIndication(Payload * payload)
+    : Payload(payload)
+{
+    receiveLength = GetData()[9] << 8 | GetData()[10];
+}
+
+char UDPReceivedIndication::GetServerSocketID()
+{
+    return GetData()[2];
+}
+
+IPAddress UDPReceivedIndication::GetRemoteIP()
+{
+    IPAddress ip;
+    ip.SetValue(GetData(), 3);
+    return ip;
+}
+
+int UDPReceivedIndication::GetRemotePort()
+{
+    return GetData()[7] << 8 | GetData()[8];
+}
+
+int UDPReceivedIndication::GetPayloadLength()
+{
+    return receiveLength;
+}
+
+char UDPReceivedIndication::GetPayload(int index)
+{
+    return GetData()[index + PAYLOAD_OFFSET];
+}
+
+const char * UDPReceivedIndication::GetPayload()
+{
+    return GetData() + PAYLOAD_OFFSET;
+}
+
+int UDPReceivedIndication::GetPayloadOffset()
+{
+    return PAYLOAD_OFFSET;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/UDPReceivedIndication.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,42 @@
+#ifndef SmartLab_MuRata_Indication_UDPReceivedIndication
+#define SmartLab_MuRata_Indication_UDPReceivedIndication
+
+#include "Payload.h"
+#include "IPAddress.h"
+
+namespace SmartLabMuRata
+{
+/// <summary>
+/// This event is generated when a UDP server (in unconnected mode) receives a packet.
+/// </summary>
+class UDPReceivedIndication : public Payload
+{
+private :
+    int receiveLength;
+
+public :
+    static const int PAYLOAD_OFFSET = 11;
+
+    UDPReceivedIndication(Payload * payload);
+
+    char GetServerSocketID();
+
+    IPAddress GetRemoteIP();
+
+    int GetRemotePort();
+
+    int GetPayloadLength();
+
+    char GetPayload(int index);
+
+    const char * GetPayload();
+
+    /// <summary>
+    /// Get the start index of the payload
+    /// </summary>
+    /// <returns></returns>
+    int GetPayloadOffset();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/WIFIConnectionIndication.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,22 @@
+#include "WIFIConnectionIndication.h"
+
+using namespace SmartLabMuRata;
+
+WIFIConnectionIndication::WIFIConnectionIndication(Payload * payload)
+    : Payload(payload)
+{ }
+
+WIFIInterface WIFIConnectionIndication::GetInterface()
+{
+    return (WIFIInterface)GetData()[2];
+}
+
+WIFICode WIFIConnectionIndication::GetStatus()
+{
+    return (WIFICode)GetData()[3];
+}
+
+string WIFIConnectionIndication::GetSSID()
+{
+    return string(GetData() + 4);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Indication/WIFIConnectionIndication.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,26 @@
+#ifndef SmartLab_MuRata_Indication_WIFIConnectionIndication
+#define SmartLab_MuRata_Indication_WIFIConnectionIndication
+
+#include "Payload.h"
+#include "WIFIInterface.h"
+#include "WIFICode.h"
+#include <string>
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class WIFIConnectionIndication : public Payload
+{
+public:
+    WIFIConnectionIndication(Payload * payload);
+
+    WIFIInterface GetInterface();
+
+    WIFICode GetStatus();
+
+    string GetSSID();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MuRata.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,760 @@
+#include "MuRata.h"
+
+using namespace SmartLabMuRata;
+
+MuRata::MuRata(PinName tx, PinName rx)
+{
+    serial = new Serial(tx,rx);
+    serial->format();
+    serial->baud(DEFAULT_BAUDRATE );
+}
+
+MuRata::MuRata(PinName tx, PinName rx, int baudrate ,int bits, Serial::Parity parity, int stop_bits)
+{
+    serial = new Serial(tx,rx);
+    serial->format(bits, parity, stop_bits);
+    serial->baud(baudrate );
+}
+
+SSIDRecordIndication * MuRata::Get_ScanResultIndication()
+{
+    if (FrameReceive()
+            && _payload.GetResponseFlag() == Request_Indication
+            && _frame.GetCommandID() == CMD_ID_WIFI
+            && _payload.GetSubCommandID() == WIFI_SCAN_RESULT_IND) {
+        return new SSIDRecordIndication(&_payload);
+    }
+
+    return NULL;
+}
+
+WIFIConnectionIndication * MuRata::Get_WiFiStatusIndication()
+{
+    if (FrameReceive()
+            && _payload.GetResponseFlag() == Request_Indication
+            && _frame.GetCommandID() == CMD_ID_WIFI
+            && _payload.GetSubCommandID() == WIFI_NETWORK_STATUS_IND) {
+        return new WIFIConnectionIndication(&_payload);
+    }
+
+    return NULL;
+}
+
+void MuRata::Send()
+{
+    _payload.SetResponseFlag(Request_Indication);
+    serial->putc(UARTFrame::SOM);
+
+    serial->putc(_frame.GetL0() | 0x80);
+    serial->putc(_frame.GetL1() | 0x80 | (_frame.GetACKRequired() ? 0x40 : 0x00));
+
+    serial->putc(_frame.GetCommandID() | 0x80);
+
+    for (int i = 0; i < _payload.GetPosition(); i++)
+        serial->putc(_payload.GetData()[i]);
+
+    serial->putc(_frame.GetChecksum() | 0x80);
+
+    serial->putc(UARTFrame::EOM);
+}
+
+bool MuRata::FrameReceive()
+{
+    int value = serial->getc();
+
+    while (value != UARTFrame::SOM)
+        value = serial->getc();
+
+    _frame.SetL0(serial->getc());
+    _frame.SetL1(serial->getc());
+
+    _frame.SetCommandID(serial->getc());
+
+    int _size = _frame.GetPayloadLength();
+
+    _payload.Allocate(_size);
+    while (_payload.GetPosition() < _size)
+        _payload.SetContent(serial->getc());
+
+    _frame.SetChecksum(serial->getc());
+
+    if (serial->getc() == UARTFrame::EOM && _frame.VerifyChecksum())
+        return true;
+    else return false;
+}
+
+VersionInfoResponse * MuRata::GEN_GetFirmwareVersionInfo()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(GEN_FW_VER_GET_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _frame.SetCommandID(CMD_ID_GEN);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new VersionInfoResponse(&_payload);
+    else
+        return NULL;
+}
+
+CMDCode MuRata::GEN_RestoreNVMtoFactoryDefault()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(GEN_RESTORE_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _frame.SetCommandID(CMD_ID_GEN);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (CMDCode)_payload.GetData()[2];
+    else
+        return GEN_NORESPONSE;
+}
+
+CMDCode MuRata::GEN_SoftReset()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(GEN_RESET_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _frame.SetCommandID(CMD_ID_GEN);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (CMDCode)_payload.GetData()[2];
+    else
+        return GEN_NORESPONSE;
+}
+
+CMDCode MuRata::GEN_UARTConfiguration(UARTConfig & config)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(GEN_UART_CFG_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(config.GetValue(), 0, 6);
+
+    _frame.SetCommandID(CMD_ID_GEN);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (CMDCode)_payload.GetData()[2];
+    else
+        return GEN_NORESPONSE;
+}
+
+
+WIFICode MuRata::WIFI_TurnOn()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_ON_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    /*
+     * Country code is a 2-character ASCII string. E.g., “US” = the United States. For the complete list, see Appendix A. The default country code is “US”, which is one of the startup parameters in NVM. If the WIFI_ON_REQ has no intention of changing the country code, put 0x0000 in the two-byte Country code, so that the firmware will use the country code configured in NVM.
+     */
+    _payload.SetContent(0x00);
+    _payload.SetContent(0x00);
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (WIFICode)_payload.GetData()[2];
+    else
+        return WIFI_NORESPONSE;
+}
+
+WIFICode MuRata::WIFI_TurnOff()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_OFF_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (WIFICode)_payload.GetData()[2];
+    else
+        return WIFI_NORESPONSE;
+}
+
+WIFICode MuRata::WIFI_SoftAPControl(SoftAPConfig * config)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_AP_CTRL_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _payload.SetContent(config->GetOnOffStatus());
+    _payload.SetContent(config->GetPersistency());
+    if (config->GetOnOffStatus() == 0x02) {
+        int length = config->GetSSID().length();
+        _payload.SetContent(config->GetSSID().c_str(), 0 , length);
+        _payload.SetContent(0x00);
+    }
+    _payload.SetContent(config->GetChannel());
+    _payload.SetContent((char)config->GetSecurityMode());
+
+    int keyLength = config->GetSecurityKey().length();
+    _payload.SetContent(keyLength);
+    if (config->GetSecurityMode() != WIFI_SECURITY_OPEN && keyLength > 0)
+        _payload.SetContent(config->GetSecurityKey().c_str(), 0 , keyLength);
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (WIFICode)_payload.GetData()[2];
+    else
+        return WIFI_NORESPONSE;
+}
+
+WIFICode MuRata::WIFI_AssociateNetwork(WIFINetwork * AP)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_JOIN_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(AP->GetSSID().c_str(), 0, AP->GetSSID().length());
+    _payload.SetContent(0x00);
+
+    _payload.SetContent((char)AP->GetSecurityMode());
+
+    int keyLength = AP->GetSecurityKey().length();
+    _payload.SetContent(keyLength);
+    if (keyLength > 0)
+        _payload.SetContent(AP->GetSecurityKey().c_str(), 0, keyLength);
+
+    if (AP->GetBSSID() != NULL) {
+        _payload.SetContent(AP->GetChannel());
+        _payload.SetContent(AP->GetBSSID(), 0, 6);
+    }
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (WIFICode)_payload.GetData()[2];
+    else
+        return WIFI_NORESPONSE;
+}
+
+WIFICode MuRata::WIFI_DisconnectNetwork()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_DISCONNECT_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (WIFICode)_payload.GetData()[2];
+    else
+        return WIFI_NORESPONSE;
+}
+WIFIStatusResponse * MuRata::WIFI_GetStatus(const WIFIInterface WiFiInterface)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_GET_STATUS_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)WiFiInterface);
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new WIFIStatusResponse(&_payload);
+    else
+        return NULL;
+}
+
+int MuRata::WIFI_GetRSSI()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_GET_STA_RSSI_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+
+    Send();
+
+    if (FrameReceive()) {
+        char value = _payload.GetData()[2];
+
+        if (value >> 7 == 0x01)
+            return (~(_payload.GetData()[2] - 1) & 0x7F) * -1;
+
+        return value;
+    } else
+        return 127;
+}
+
+WIFICode MuRata::WIFI_StartWPSProcess(const WPSMode mode, const char * pin, int pinLength)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_WPS_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)mode);
+
+    if (mode == Pin) {
+        if (Pin == NULL)
+            return WIFI_NORESPONSE;
+
+        _payload.SetContent(pin, 0 , pinLength);
+        _payload.SetContent(0x00);
+    }
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (WIFICode)_payload.GetData()[2];
+    else
+        return WIFI_NORESPONSE;
+}
+
+WIFICode MuRata::WIFI_ScanNetworks(const ScanType scan, const BSSType bss)
+{
+    /*
+     * This command instructs the module to scan available networks. Parameters are as follows:
+     * UINT8 Request Sequence
+     * UINT8 Scan Type
+     * UINT8 BSS Type
+     * UINT8 BSSID [6]
+     * UINT8 Channel list []
+     * UINT8 SSID[]
+     * BSSID, Channel List, and SSID are optional fields. All 0’s for BSSID, Channel list or SSID indicates it is not present.
+     * - Scan Type: 0 = Active scan, 1= Passive scan
+     * - BSS Type: 0 = Infrastructure, 1 = ad hoc, 2 = any
+     * - BSSID: 6 bytes MAC address of the AP or STA. 6 bytes of 0’s indicates it is not present.
+     * - Channel list: 0 terminated array, up to 10 array elements.
+     * - SSID: 0 terminated string for the AP or STA SSID, up to 33 bytes including NUL-termination.
+     */
+
+    _payload.Rewind();
+    _payload.SetSubCommandID(WIFI_SCAN_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)scan);
+    _payload.SetContent((char)bss);
+
+    for (int i = 0; i < 8; i++)
+        _payload.SetContent(0x00);
+
+    _frame.SetCommandID(CMD_ID_WIFI);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (WIFICode)_payload.GetData()[2];
+    else
+        return WIFI_NORESPONSE;
+}
+
+InitializationResponse * MuRata::SNIC_Initialization(int receiveBufferSize)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_INIT_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(receiveBufferSize >> 8);
+    _payload.SetContent(receiveBufferSize);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new InitializationResponse(&_payload);
+    else
+        return NULL;
+}
+
+SNICCode MuRata::SNIC_Cleanup()
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_CLEANUP_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (SNICCode)_payload.GetData()[2];
+    else
+        return SNIC_NORESPONSE;
+
+}
+
+
+SendFromSocketResponse * MuRata::SNIC_SendFromSocket(const char SocketID, const SocketSentOption option, const char * payload, int offset, int length)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_SEND_FROM_SOCKET_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(SocketID);
+    _payload.SetContent((char)option);
+    _payload.SetContent(length >> 8);
+    _payload.SetContent(length);
+    _payload.SetContent(payload, offset, length);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new SendFromSocketResponse(&_payload);
+    else
+        return NULL;
+}
+
+SNICCode MuRata::SNIC_SloseSocket(const char SocketID)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_CLOSE_SOCKET_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(SocketID);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (SNICCode)_payload.GetData()[2];
+    else
+        return SNIC_NORESPONSE;
+}
+
+DHCPInfoResponse * MuRata::SNIC_GetDHCPInfo(const WIFIInterface wifiInterface)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_GET_DHCP_INFO_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)wifiInterface);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new DHCPInfoResponse(&_payload);
+    else
+        return NULL;
+}
+
+IPAddress MuRata::SNIC_ResolveHostName(const string * host)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_RESOLVE_NAME_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)STA);
+    _payload.SetContent((char)host->length());
+    _payload.SetContent(host->c_str(), 0, host->length());
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    IPAddress ip;
+
+    if (FrameReceive())
+        if ((SNICCode)_payload.GetData()[2] == SNIC_SUCCESS)
+            ip.SetValue(_payload.GetData(), 3);
+
+    return ip;
+}
+
+SNICCode MuRata::SNIC_ConfigureDHCPorStaticIP(DHCPConfig * config)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_IP_CONFIG_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)config->GetInterface());
+    _payload.SetContent((char)config->GetDHCPMode());
+
+    if (config->GetDHCPMode() != dynamic_IP) {
+        _payload.SetContent(config->GetLocalIP()->GetValue(), 0, 4);
+        _payload.SetContent(config->GetNetmask()->GetValue(), 0, 4);
+        _payload.SetContent(config->GetGatewayIP()->GetValue(), 0, 4);
+    }
+
+    if (config->GetDHCPMode() == soft_AP) {
+        _payload.SetContent(config->GetIPRangeFirst()->GetValue(), 0, 4);
+        _payload.SetContent(config->GetIPRangeLast()->GetValue(), 0, 4);
+    }
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return (SNICCode)_payload.GetData()[2];
+    else
+        return SNIC_NORESPONSE;
+}
+
+SocketStartReceiveResponse * MuRata::SNIC_ConnectTCPServer(const char SocketID, IPAddress * remoteIP, const int remotePort, const char timeout, const int receiveBufferSize)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_TCP_CONNECT_TO_SERVER_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(SocketID);
+    _payload.SetContent(remoteIP->GetValue(), 0, 4);
+    _payload.SetContent((char)(remotePort >> 8));
+    _payload.SetContent((char)remotePort);
+    _payload.SetContent((char)(receiveBufferSize >> 8));
+    _payload.SetContent((char)receiveBufferSize);
+    _payload.SetContent(timeout);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new SocketStartReceiveResponse(&_payload);
+    else
+        return NULL;
+}
+
+CreateSocketResponse * MuRata::SNIC_CreateTCPSocket(const bool bind, IPAddress * localIP, const int localPort)
+{
+    return SNIC_CreateSocket(SNIC_TCP_CREATE_SOCKET_REQ, bind, localIP, localPort);
+}
+
+CreateSocketResponse * MuRata::SNIC_CreateUDPSocket(const bool bind, IPAddress * localIP, const int localPort)
+{
+    return SNIC_CreateSocket(SNIC_UDP_CREATE_SOCKET_REQ, bind, localIP, localPort);
+}
+
+CreateSocketResponse * MuRata::SNIC_CreateSocket(const SubCommandID subID, const bool bind, IPAddress * localIP, const int localPort)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(subID);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)(bind ? 0x01 : 0x00));
+
+    if (bind) {
+        if (localIP != NULL)
+            _payload.SetContent(localIP->GetValue(), 0, 4);
+        else {
+            _payload.SetContent(0x00);
+            _payload.SetContent(0x00);
+            _payload.SetContent(0x00);
+            _payload.SetContent(0x00);
+        }
+
+        _payload.SetContent((char)(localPort >> 8));
+        _payload.SetContent((char)localPort);
+    }
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new CreateSocketResponse(&_payload);
+    else
+        return NULL;
+}
+
+SocketStartReceiveResponse * MuRata::SNIC_StartUDPReceive(const char SocketID, const int receiveBufferSize)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_UDP_START_RECV_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(SocketID);
+    _payload.SetContent((char)(receiveBufferSize >> 8));
+    _payload.SetContent((char)receiveBufferSize);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new SocketStartReceiveResponse(&_payload);
+    else
+        return NULL;
+}
+
+SendFromSocketResponse * MuRata::SNIC_SendUDPPacket(IPAddress * remoteIP, const int remotePort, const char * payload, int offset, int length)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_UDP_SIMPLE_SEND_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(remoteIP->GetValue(), 0 ,4);
+    _payload.SetContent((char)(remotePort >> 8));
+    _payload.SetContent((char)remotePort);
+    _payload.SetContent((char)(length >> 8));
+    _payload.SetContent((char)length);
+    _payload.SetContent(payload, offset, length);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new SendFromSocketResponse(&_payload);
+    else
+        return NULL;
+}
+
+SendFromSocketResponse * MuRata::SNIC_SendUDPFromSocket(IPAddress * remoteIP, const int remotePort, const char SocketID, const bool connectServer, const char * payload, int offset, int length)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_UDP_SEND_FROM_SOCKET_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent(remoteIP->GetValue(),0, 4);
+    _payload.SetContent((char)(remotePort >> 8));
+    _payload.SetContent((char)remotePort);
+    _payload.SetContent(SocketID);
+    _payload.SetContent((char)(connectServer ? 0x01 : 0x00));
+    _payload.SetContent((char)(length >> 8));
+    _payload.SetContent((char)length);
+    _payload.SetContent(payload, offset, length);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new SendFromSocketResponse(&_payload);
+    else
+        return NULL;
+}
+
+HTTPResponse * MuRata::SNIC_SendHTTPRequest(HTTPContent * content, const bool isHTTPS, const bool chunked)
+{
+    _payload.Rewind();
+    if (isHTTPS)
+        _payload.SetSubCommandID(SNIC_HTTPS_REQ);
+    else
+        _payload.SetSubCommandID(SNIC_HTTP_REQ);
+
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+    _payload.SetContent((char)(content->GetRemotePort() >> 8));
+    _payload.SetContent((char)content->GetRemotePort());
+    _payload.SetContent((char)content->GetMethod());
+    _payload.SetContent(content->GetTimeout());
+
+    _payload.SetContent(content->GetRemoteHost()->c_str(), 0, content->GetRemoteHost()->length());
+    _payload.SetContent(0x00);
+
+    _payload.SetContent(content->GetURI()->c_str(), 0, content->GetURI()->length());
+    _payload.SetContent(0x00);
+
+    _payload.SetContent(content->GetContentType()->c_str(), 0, content->GetContentType()->length());
+    _payload.SetContent(0x00);
+
+    string * _others = new string();
+    content->GetOtherHeaders(_others);
+    _payload.SetContent(_others->c_str(), 0, _others->length());
+    _payload.SetContent(0x00);
+    delete _others;
+
+    if (content->GetMethod() == POST) {
+        int length = content->GetContentLength();
+
+        char msb = (char)(length >> 8);
+        if (chunked)
+            msb |= 0x80;
+        else msb &= 0x7F;
+
+        _payload.SetContent(msb);
+        _payload.SetContent((char)length);
+
+        if (length > 0)
+            _payload.SetContent(content->GetBody(), 0, length);
+    }
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (FrameReceive())
+        return new HTTPResponse(&_payload);
+    else
+        return NULL;
+}
+
+HTTPResponse * MuRata::SNIC_SendHTTPMoreRequest(HTTPContent * content, const bool chunked)
+{
+    _payload.Rewind();
+    _payload.SetSubCommandID(SNIC_HTTP_MORE_REQ);
+    _payload.SetFrameID(_payload.GetFrameID() + 1);
+
+    int length = content->GetContentLength();
+    char msb = (char)(length >> 8);
+    if (chunked)
+        msb |= 0x80;
+    else msb &= 0x7F;
+
+    _payload.SetContent(msb);
+    _payload.SetContent((char)length);
+
+    if (length > 0)
+        _payload.SetContent(content->GetBody(), 0, length);
+
+    _frame.SetCommandID(CMD_ID_SNIC);
+    _frame.SetPayload(&_payload);
+
+    Send();
+
+    if (chunked)
+        return NULL;
+
+    if (FrameReceive())
+        return new HTTPResponse(&_payload);
+    else
+        return NULL;
+}
+
+CreateSocketResponse * MuRata::SNIC_CreateAdvancedTLSTCP(const bool bind, IPAddress * localIP, const int localPort)
+{
+    return SNIC_CreateSocket(SNIC_TCP_CREATE_ADV_TLS_SOCKET_REQ, bind, localIP, localPort);
+}
+
+CreateSocketResponse * MuRata::SNIC_CreateSimpleTLSTCP(const bool bind, IPAddress * localIP, const int localPort)
+{
+    return SNIC_CreateSocket(SNIC_TCP_CREAET_SIMPLE_TLS_SOCKET_REQ, bind, localIP, localPort);
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MuRata.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,377 @@
+#ifndef SmartLab_MuRata_MuRata
+#define SmartLab_MuRata_MuRata
+
+#include "Payload.h"
+#include "UARTFrame.h"
+
+#include "UARTConfig.h"
+#include "DHCPConfig.h"
+#include "SoftAPConfig.h"
+
+#include "CMDCode.h"
+#include "SNICCode.h"
+#include "WIFICode.h"
+
+#include "BSSType.h"
+#include "CommandID.h"
+#include "DHCPMode.h"
+#include "HTTPContent.h"
+#include "IPAddress.h"
+#include "ResetCode.h"
+#include "ScanType.h"
+#include "SecurityMode.h"
+#include "SocketSentOption.h"
+#include "SubCommandID.h"
+#include "WIFIInfo.h"
+#include "WIFINetwork.h"
+#include "WIFINetworkDetail.h"
+#include "WIFIInterface.h"
+#include "WIFIStatusCode.h"
+#include "WPSMode.h"
+
+#include "PowerUpIndication.h"
+#include "SSIDRecordIndication.h"
+#include "TCPStatusIndication.h"
+#include "SocketReceiveInidcation.h"
+#include "UDPReceivedIndication.h"
+#include "WIFIConnectionIndication.h"
+#include "HTTPResponseIndication.h"
+
+#include "VersionInfoResponse.h"
+#include "WIFIStatusResponse.h"
+#include "InitializationResponse.h"
+#include "SendFromSocketResponse.h"
+#include "CreateSocketResponse.h"
+#include "SocketStartReceiveResponse.h"
+#include "DHCPInfoResponse.h"
+#include "HTTPResponse.h"
+
+#include "mbed.h"
+
+namespace SmartLabMuRata
+{
+class MuRata
+{
+private :
+    Serial * serial;
+    Payload _payload;
+    UARTFrame _frame;
+
+    void Send();
+
+    bool FrameReceive();
+
+    CreateSocketResponse * SNIC_CreateSocket(const SubCommandID subID, const bool bind = false, IPAddress * localIP = NULL, const int localPort = 0);
+
+public:
+
+    static const int DEFAULT_BAUDRATE = 921600;
+
+    // ##############################################################################
+    //                                indication
+    // ##############################################################################
+
+    SSIDRecordIndication * Get_ScanResultIndication();
+
+    WIFIConnectionIndication * Get_WiFiStatusIndication();
+
+    // ##############################################################################
+    //                                constructor
+    // ##############################################################################
+
+    MuRata(PinName tx, PinName rx);
+
+    MuRata(PinName tx, PinName rx, int baudrate ,int bits=8, Serial::Parity parity=SerialBase::None, int stop_bits=1);
+
+
+    // ##############################################################################
+    //                                   GEN
+    // ##############################################################################
+
+    /// <summary>
+    /// SNIC firmware has a built in version string. Use this command to retrieve the version info.
+    /// </summary>
+    /// <returns>return null when timeout</returns>
+    VersionInfoResponse * GEN_GetFirmwareVersionInfo();
+
+    /// <summary>
+    /// This command restores the data stored in NVM to factory default values. Any web page update is not affected by this command.
+    /// A soft reset will be performed automatically after the NVM has been restored.
+    /// Application needs to send WIFI_GET_STATUS_REQ or SNIC_GET_DHCP_INFO_REQ commands to determine the new state of the Murata module.
+    /// </summary>
+    /// <returns></returns>
+    CMDCode GEN_RestoreNVMtoFactoryDefault();
+
+    /// <summary>
+    /// This command resets the module. Application needs to send WIFI_GET_STATUS_REQ or SNIC_GET_DHCP_INFO_REQ commands to determine the new state of the module after the reset.
+    /// </summary>
+    /// <returns></returns>
+    CMDCode GEN_SoftReset();
+
+    /// <summary>
+    /// This command configures the UART interface. The specified parameters are saved into the NVM and they are used for the specified UART interface in subsequent powerups.
+    /// </summary>
+    /// <param name="config"></param>
+    /// <returns></returns>
+    CMDCode GEN_UARTConfiguration(UARTConfig & config);
+
+    // ##############################################################################
+    //                                   WiFi
+    // ##############################################################################
+
+    /// <summary>
+    /// This command turns on Wifi on module.
+    /// The default country code is “US”, which is one of the startup parameters in NVM. If the WIFI_ON_REQ has no intention of changing the country code, put 0x0000 in the two-byte Country code, so that the firmware will use the country code configured in NVM.
+    /// The module supports both soft AP mode and STA mode at the same time. The module has reserved flash space (NVM) to store startup parameters for both the soft AP and the STA. Only STA’s parameters can be dynamically changed at run time.
+    /// Turning on WiFi would cause the following to happen:
+    /// The following operations occur using the parameters specified in the NVM if the AP mode is enabled.
+    /// 1. Turn on the soft AP
+    /// 2. Starts DNS server, DHCP server and HTTP server. The HTTP server provides a means for configuring the WLAN access parameters for the STA.
+    /// Turn on the STA. If the NVM has valid startup parameters, the STA will try to join the saved SSID with saved authentication information. The NVM also stores whether DHCP or static IP is used for STA. If DHCP is used, DHCP client will be started. After a successful join, STA’s IP will be configured according to the NVM.
+    /// By default, the soft AP is turned on to allow user to use a WiFi enabled computer to connect to the soft AP, and instructs the STA to join one of the surrounding APs. So WiFi is turned on by default and this command is not required at startup.
+    /// </summary>
+    /// <returns></returns>
+    WIFICode WIFI_TurnOn();
+
+    /// <summary>
+    /// This command turns off Wifi on module. Turning off WiFi causes the following to happen:
+    /// 1. Turn off the soft AP, including shutting down DNS server, DHCP server and HTTP server.
+    /// 2. Disconnect STA from any joined network, and close all sockets opened by application.
+    /// </summary>
+    /// <returns></returns>
+    WIFICode WIFI_TurnOff();
+
+    /// <summary>
+    /// This command turns on or off the soft AP. The WIFI_ON(OFF)_REQ controls both the soft AP and STA at the same time, while this command only controls the soft AP.
+    /// An example use case is, the soft AP (and its web server) is turned on at startup to configure STA to join a network and is no longer needed after the STA is connected.
+    /// WIFI_AP_CTRL_REQ can be used to turn the soft AP off.
+    /// OnOff = 0 indicates AP is to be turned off. The rest of the parameters are ignored.
+    /// OnOff = 1 indicates turning on soft AP using existing NVM parameters,
+    /// OnOff = 2 indicates turning on AP with the parameters provided. If the soft AP is already on, it is first turned off.
+    /// Persistency=1 indicates the soft AP’s on/off state and parameters (if OnOff = 2) will be saved in NVM. For example, if OnOff =0 and Persistency=1, the soft AP will not be turned on after a reset.
+    /// </summary>
+    /// <param name="config"></param>
+    /// <returns></returns>
+    WIFICode WIFI_SoftAPControl(SoftAPConfig * config);
+
+    /// <summary>
+    /// This command instructs module to associate to a network.
+    /// </summary>
+    /// <param name="AP"></param>
+    /// <returns></returns>
+    WIFICode WIFI_AssociateNetwork(WIFINetwork * AP);
+
+    /// <summary>
+    /// This command instructs the module to disconnect from a network.
+    /// Upon a successful reception of the command, the module disconnects from associated network. Sockets opened by application are not closed.
+    /// </summary>
+    /// <returns></returns>
+    WIFICode WIFI_DisconnectNetwork();
+
+    /// <summary>
+    /// This command queries the WiFi status from module. This command should be called by application after startup to determine the WiFi status since the module may have joined an AP automatically based on NVM parameters (see 6.1).
+    /// </summary>
+    /// <param name="WiFiInterface"></param>
+    /// <returns></returns>
+    WIFIStatusResponse * WIFI_GetStatus(const WIFIInterface WiFiInterface);
+
+    /// <summary>
+    /// This command requests the reporting of the current RSSI from module’s STA interface
+    /// </summary>
+    /// <returns>RSSI in dBm. 127 means unspecified value</returns>
+    int WIFI_GetRSSI();
+
+    /// <summary>
+    /// This command requests the module to use WPS to join the network. Two methods are supported: push button and pin-based configuration.
+    /// If Mode is 1, Pin value must be present. Pin value is NUL terminated ASCII string. Pin string length of 0, 4, 7, or 8 is valid. When length is 0, the module will use the WPS default pin configured in the NVM by using the SNIC monitor. When length is 8, the 8th digit must be the correct checksum of the first 7 digits. The pin checksum calculation method can be found from the Internet. When the length is 7, the module firmware will calculate the checksum automatically. When the length is 4, no checksum is required.
+    /// Upon a successful reception of the command, the module tries to associate to a network using the WPS configuration specified. Upon a successful completion of the join process, the SSID and authentication parameters will be saved in NVM which will be used in subsequent power up (see 6.1).
+    /// </summary>
+    /// <param name="mode"></param>
+    /// <param name="Pin"></param>
+    /// <returns></returns>
+    WIFICode WIFI_StartWPSProcess(const WPSMode mode, const char * pin = NULL, int pinLength = 0);
+
+    /// <summary>
+    /// Upon a successful reception of the command, the module starts to scan. The response will indicate only WIFI_SUCCESS if no error. Actual scan result shall be sent from module as multiple indications defined in WIFI_SCAN_RESULT_IND
+    /// </summary>
+    /// <param name="scan"></param>
+    /// <param name="bss"></param>
+    /// <param name="BSSID">6 bytes MAC address of the AP or STA.</param>
+    /// <param name="channelList">up to 10 array elements</param>
+    /// <param name="SSID">string for the AP or STA SSID, up to 32 bytes</param>
+    /// <returns></returns>
+    WIFICode WIFI_ScanNetworks(const ScanType scan, const BSSType bss);
+
+    // ##############################################################################
+    //                                   SNIC
+    // ##############################################################################
+
+    /// <summary>
+    /// This command initializes the SNIC networking framework on module. TCP/UDP socket communication may be performed only after this command is called.
+    /// The Default receive buffer size is the default maximum size of receive buffer in the module. If 0 is specified, a system defined value (2048) will be used. If there is a Receive buffer size field in other commands, then it must be less than or equal to the Default receive buffer size. If the Receive buffer size in any of those commands is 0, the Default receive buffer size will be used.
+    /// </summary>
+    /// <param name="receiveBufferSize">Upon a successful reception of the command, the module sends to the host the following response. If user specified Default receive buffer size is bigger than what the module can handle, the system defined value will be returned in the response; otherwise, user specified Default receive buffer size will be retuned. Maximum number of UDP and TCP sockets supported by module will also be returned.</param>
+    /// <returns></returns>
+    InitializationResponse * SNIC_Initialization(int receiveBufferSize = 0);
+
+    /// <summary>
+    /// This command closes the SNIC networking framework on module. It should cleanup resources for socket communication on module. If some sockets are not closed, this command will close all of them. No more network communication can be performed until SNIC_INIT_REQ is called.
+    /// </summary>
+    /// <returns></returns>
+    SNICCode SNIC_Cleanup();
+
+    /// <summary>
+    /// In TCP server case, Socket is the socket number returned by SNIC_TCP_CLIENT_SOCKET_IND. In TCP client case, Socket can be either from SNIC_CONNECT_TO_TCP_SERVER_RSP, or from the SNIC_TCP_CONNECTION_STATUS_IND with SNIC_CONNECTION_UP status. In UDP case, Socket is the socket number returned by SNIC_UDP_CREATE_SOCKET_REQ and it must be in connected mode.
+    /// A success response of this command does not guarantee the receiver receives the packet. If error occurs, a SNIC_TCP_CONNECTION_STATUS_IND with SNIC_SOCKET_CLOSED will be sent to the application in TCP case. No indication will be sent in UDP case.
+    /// Option is the action module will perform to the socket after the send operation. Use it when application is sure to close or shutdown the connection after sending. The effect is the same as using SNIC_CLOSE_SOCKET_REQ, but round-trip UART traffic is reduced.
+    /// </summary>
+    /// <param name="SocketID"></param>
+    /// <param name="option"></param>
+    /// <returns></returns>
+    SendFromSocketResponse * SNIC_SendFromSocket(const char SocketID, const SocketSentOption option, const char * payload, int offset, int length);
+
+    /// <summary>
+    /// This command instructs the module to close a socket.
+    /// </summary>
+    /// <param name="SocketID"></param>
+    /// <returns></returns>
+    SNICCode SNIC_SloseSocket(const char SocketID);
+
+    /// <summary>
+    /// This command queries the DHCP information for a particular interface.
+    /// </summary>
+    /// <param name="wifiInterface"></param>
+    /// <returns></returns>
+    DHCPInfoResponse * SNIC_GetDHCPInfo(const WIFIInterface wifiInterface);
+
+    /// <summary>
+    /// This command converts a remote host name to IP address.
+    /// Interface number is either 0 or 1. 0 indicates STA interface. 1 indicates soft AP interface. Currently only STA interface is supported.
+    /// If multiple SNIC_RESOLVE_NAME_REQ’s need to be sent, it is required they be sent sequentially due to resource limitation. If the name is not resolved, it takes up to 15 seconds for the failure response to come back. While waiting for the response, host application can send other commands (except for SNIC_RESOLVE_NAME_REQ and SNIC_SEND_ARP_REQ).
+    /// </summary>
+    /// <param name="host"></param>
+    /// <returns></returns>
+    IPAddress SNIC_ResolveHostName(const string * host);
+
+    /// <summary>
+    /// This command instructs module configure the mechanism for obtaining the IP address.
+    /// DHCP mode specifies how the address is assigned for the interface.
+    ///  0: interface is assigned the static IP, NetMask and Gateway IP. First IP and Last IP are not present. Any active DHCP client or server is stopped.
+    ///  1: STA interface uses DHCP to obtain the address. All subsequent fields are not present. STA DHCP client is started if necessary.
+    ///  2: only for AP interface. If the soft AP is not started or SNIC_INIT_REQ is not done, this command fails. Otherwise, this command stops the HTTP server, DNS server and DHCP server if configured, and restarts them with new parameters. It assigns IP for clients in range [First IP, Last IP] within the subnet mask. The AP itself is assigned the address within the same subnet specified by IP which must not be in the range of [First IP, Last IP]. The value of GTW IP and IP should be the same. If there are clients connected to the soft AP before this command, make sure the clients reconnect to the soft AP after this command.
+    /// </summary>
+    /// <param name="config"></param>
+    /// <returns></returns>
+    SNICCode SNIC_ConfigureDHCPorStaticIP(DHCPConfig * config);
+    
+    /// <summary>
+    /// If the connect attempt is immediately completed, the response will contain SNIC_SUCCESS status, with the actual Receive buffer size.
+    /// If the connect attempt is not immediately completed, the response will have the SNIC_COMMAND_PENDING status. The Timeout value is the time (in seconds) the module will wait before aborting the connection attempt. If timeout occurs, the SNIC_TCP_CONNECTION_STATUS_IND indication with SNIC_TIMEOUT status will be sent to the application. If connection is successful before timeout, the SNIC_TCP_CONNECTION_STATUS_IND with SNIC_CONNECTION_UP status will be sent to the application. Timeout value should be non-zero.
+    /// </summary>
+    /// <param name="remoteHost"></param>
+    /// <param name="port"></param>
+    /// <param name="timeout">in seconds</param>
+    /// <param name="receiveBufferSize">Receive buffer size is the maximum packet size the application wants to receive per transmission. It must be less than or equal to the Default receive buffer size from SNIC_INIT_REQ in the module. If it is 0 or exceeds the system capability, the Default receive buffer size is returned.</param>
+    SocketStartReceiveResponse * SNIC_ConnectTCPServer(const char SocketID, IPAddress * remoteIP, const int remotePort, const char timeout, const int receiveBufferSize = 0);
+    
+    /// <summary>
+    /// If Bind option is 0, the socket will not be bound, and Local IP address and Local port should not be present. Otherwise, it will be bound to Local IP address and Local port specified. 0x0 for IP or port are valid, which means system assigned. Port number 5000 is reserved for internal use.
+    /// the socket number must get and store separately, since the response payload may change
+    /// </summary>
+    /// <param name="bing">do not bing if this tcp socket is used as a client</param>
+    /// <param name="localIP"></param>
+    /// <param name="localPort"></param>
+    /// <returns></returns>
+    CreateSocketResponse * SNIC_CreateTCPSocket(const bool bind = false, IPAddress * localIP = NULL, const int localPort = 0);
+
+    /// <summary>
+    /// If Bind option is 0, the socket will not be bound, and Local IP address and Local port should not be present. Otherwise, it will be bound to Local IP address and Local port specified. 0x0 for IP or port are valid, which means system assigned. Port number 5000 is reserved for internal use.
+    /// the socket number must get and store separately, since the response payload may change
+    /// </summary>
+    /// <param name="bind"></param>
+    /// <param name="localIP"></param>
+    /// <param name="localPort"></param>
+    /// <returns></returns>
+    CreateSocketResponse * SNIC_CreateUDPSocket(const bool bind = false, IPAddress * localIP = NULL, const int localPort = 0);
+
+    /// <summary>
+    /// The Socket should have been created by command SNIC_UDP_CREATE_SOCKET_REQ. The same socket can be used in SNIC_UDP_SEND_FROM_SOCKET_REQ command, so that send and receive can be done via the same socket (port). The application is responsible to close the socket using SNIC_CLOSE_SOCKET_REQ.
+    /// Receive buffer size is the maximum packet size the application wants to receive per transmission. It must be less than or equal to the Default receive buffer size from SNIC_INIT_REQ in the module. If 0 or exceeds the system capability, the Default receive buffer size will be used and returned in the response.
+    /// After this command, the Socket can receive any UDP sender with connected mode or non-connected mode. The module will generate SNIC_UDP_RECV_IND indication for incoming data, which includes sender’s IP and port info.
+    /// But if this Socket is later connected to a peer UDP server by SNIC_UDP_SEND_FROM_SOCKET_REQ with Connection mode set to1, the module will generate SNIC_CONNECTION_RECV_IND indication without the sender’s IP and port info. See Section 5.19. After that, this Socket will only be able to receive from the one sender it connects to.
+    /// </summary>
+    /// <param name="SocketID"></param>
+    /// <param name="receiveBufferSize"></param>
+    SocketStartReceiveResponse * SNIC_StartUDPReceive(const char SocketID, const int receiveBufferSize = 0);
+
+    /// <summary>
+    /// A socket will be created for sending the packet out through the default network connection, but will be closed after the transmission. This command can be used when the application just wants to send out one packet to peer, and it also does not expect to receive any packets from peer.
+    /// </summary>
+    /// <param name="remoteIP"></param>
+    /// <param name="remotePort"></param>
+    /// <param name="payload"></param>
+    /// <param name="offset"></param>
+    /// <param name="length"></param>
+    SendFromSocketResponse * SNIC_SendUDPPacket(IPAddress * remoteIP, const int remotePort, const char * payload, const int offset, const int length);
+
+    /// <summary>
+    /// The Socket should have been created by command SNIC_UDP_CREATE_SOCKET_REQ. If SNIC_UDP_START_RECV_REQ is not called on the socket, the application can only send out UDP packet from this socket. If SNIC_UDP_START_RECV_REQ has been called for this socket, the application can send and receive UDP packets from the socket. This implies the application can send and receive packets from the same local port. The application is responsible to close the socket using SNIC_CLOSE_SOCKET_REQ.
+    /// If Connection mode is 1, the module will first connect to the UDP server then send data. Since the socket is still connected after the call, application can send subsequent data using another command SNIC_SEND_FROM_SOCKET_REQ.
+    /// The benefit of the connected mode is that subsequent send can use SNIC_SEND_FROM_SOCKET_REQ, which does not require the receiver’s IP and port every time, and thus reduces overhead. If this socket is also used to receive by calling SNIC_UDP_START_RECV_REQ, the receive indication to the host will also omits the sender IP and port info, further reducing overhead.
+    /// </summary>
+    /// <param name="remoteIP"></param>
+    /// <param name="remotePort"></param>
+    /// <param name="SocketID"></param>
+    /// <param name="connectServer"></param>
+    /// <param name="payload"></param>
+    /// <param name="offset"></param>
+    /// <param name="length"></param>
+    /// <returns></returns>
+    SendFromSocketResponse * SNIC_SendUDPFromSocket(IPAddress * remoteIP, const int remotePort, const char SocketID, const bool connectServer, const char * payload, int offset, const int length);
+
+    /// <summary>
+    /// This command instructs the module to send a HTTP request packet to the remote HTTP server.
+    /// Post content can be binary. So even if it is text string, it should not contain NUL at the end. The most significant bit of Post content length is reserved to indicate if there is more data to send. If there is more data to send (as indicated by MSBit=1 in the content length), host application should use another API (SNIC_HTTP_MORE_REQ) to send the rest of the data until it is finished. If this bit is set to 1, then the “Transfer-Encoding” in the HTTP request will be set to “chunked” by SNIC. For GET method, the highest bit of Content length must be set to 0 (not chunked).
+    /// For HTTP request with chunked encoding, status code of SNIC_SUCCESS in the response only means the HTTP request has been sent. After one or more subsequent SNIC_HTTP_MORE_REQ/RSPs, the last SNIC_HTTP_MORE_RSP with HTTP status code will be sent to host containing the data from HTTP server.
+    /// The most significant bit of Content length is reserved to indicate if there is more response data to send to the host. If there is more data to send (Content length MSBit=1), module uses SNIC_HTTP_RSP_IND to send the rest of the data until it is finished, i.e., when this bit is 1, the host application should continue to receive SNIC_HTTP_RSP_IND, until this bit is 0.
+    /// The Content length is limited by the receive buffer size specified in SNIC_INIT_REQ and the system resource at that moment.
+    /// </summary>
+    /// <param name="content"></param>
+    /// <param name="isHTTPS"></param>
+    /// <param name="chunked"></param>
+    /// <returns></returns>
+    HTTPResponse * SNIC_SendHTTPRequest(HTTPContent * content, const bool isHTTPS = false, const bool chunked = false);
+
+    /// <summary>
+    /// This command instructs the module to send a subsequent HTTP request packet to the remote HTTP server if the initial SNIC_HTTP_REQ cannot finish the packet due to size or other consideration. It is used when the send method is POST.
+    /// </summary>
+    /// <param name="content"></param>
+    /// <param name="chunked"></param>
+    /// <returns></returns>
+    HTTPResponse * SNIC_SendHTTPMoreRequest(HTTPContent * content, const bool chunked = false);
+
+    /// <summary>
+    /// If Bind option is 0, the socket will not be bound, and Local IP address and Local port should not be present. Otherwise, it will be bound to Local IP address and Local port specified. 0x0 for IP or port are valid, which means system assigned. Port number 5000 is reserved for internal use.
+    /// the socket number must get and store separately, since the response payload may change
+    /// </summary>
+    /// <param name="bing">do not bing if this tcp socket is used as a client</param>
+    /// <param name="localIP"></param>
+    /// <param name="localPort"></param>
+    /// <returns></returns>
+    CreateSocketResponse * SNIC_CreateAdvancedTLSTCP(const bool bind, IPAddress * localIP = NULL, const int localPort = 0);
+
+    /// <summary>
+    /// If Bind option is 0, the socket will not be bound, and Local IP address and Local port should not be present. Otherwise, it will be bound to Local IP address and Local port specified. 0x0 for IP or port are valid, which means system assigned. Port number 5000 is reserved for internal use.
+    /// the socket number must get and store separately, since the response payload may change
+    /// </summary>
+    /// <param name="bind"></param>
+    /// <param name="localIP"></param>
+    /// <param name="localPort"></param>
+    /// <returns></returns>
+    CreateSocketResponse * SNIC_CreateSimpleTLSTCP(const bool bind, IPAddress * localIP = NULL, const int localPort = 0);
+
+
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Payload.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,118 @@
+#include "Payload.h"
+
+using namespace SmartLabMuRata;
+
+Payload::Payload()
+{
+    max = EXPANDSIZE;
+    data = new char[EXPANDSIZE];
+    position = 0;
+}
+
+Payload::Payload(Payload * payload)
+{
+    this->data = payload->data;
+    this->position = payload->position;
+}
+
+const char * Payload::GetData()
+{
+    return data;
+}
+
+ResponseFlag Payload::GetResponseFlag()
+{
+    if ((data[0] >> 7) == 0x01)
+        return Response_Confirmation;
+    else return Request_Indication;
+}
+
+void Payload::SetResponseFlag(const ResponseFlag flag)
+{
+    if (flag == Request_Indication)
+        data[0] &= 0x7F;
+    else data[0] |= 0x80;
+}
+
+SubCommandID Payload::GetSubCommandID()
+{
+    return (SubCommandID)(data[0] & 0x7F);
+}
+
+void Payload::SetSubCommandID(const SubCommandID id)
+{
+    SetSubCommandID((char)id);
+}
+
+void Payload::SetSubCommandID(const int value)
+{
+    data[0] = (data[0] & 0x80) | (value & 0x7F);
+    position = 1;
+}
+
+char Payload::GetFrameID()
+{
+    return data[1];
+}
+
+void Payload::SetFrameID(const char frameID)
+{
+    data[1] = frameID;
+    position = 2;
+}
+
+int Payload::GetPosition()
+{
+    return position;
+}
+
+void Payload::SetPosition(const int position)
+{
+    if (this->position > max)
+        this->position = max;
+    else this->position = position;
+}
+
+void Payload::Allocate(const int length)
+{
+    if (length <= 0)
+        return;
+
+    if (length > max) {
+        delete data;
+        data = new char[length];
+    }
+
+    Rewind();
+}
+
+void Payload::Rewind()
+{
+    position = 0;
+}
+
+void Payload::SetContent(const char value)
+{
+    if (position >= max) {
+        char temp[max + EXPANDSIZE];
+        memcpy(temp, data, position);
+        delete data;
+        data = temp;
+    }
+
+    data[position++] = value;
+}
+
+void Payload::SetContent(const char * value, const int offset, const int length)
+{
+    if (position + length - offset>= max) {
+        max += EXPANDSIZE * (1 + length / EXPANDSIZE);
+        char temp[max];
+        memcpy(temp, data, position);
+        delete data;
+        data = temp;
+    }
+
+    memcpy(data + position, value, length);
+    position += length;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Payload.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,75 @@
+#ifndef SmartLab_MuRata_Payload
+#define SmartLab_MuRata_Payload
+
+#include "mbed.h"
+
+#include "ResponseFlag.h"
+#include "SubCommandID.h"
+
+
+namespace SmartLabMuRata
+{
+class Payload
+{
+private :
+
+    static const int EXPANDSIZE = 1024;
+
+    char * data;
+
+    int position;
+    
+    int max;
+
+public:
+    Payload();
+
+    Payload(Payload * payload);
+
+    const char * GetData();
+
+    /// <summary>
+    /// The first byte of the Payload of the command describes the specific operation to perform for the Command ID, and it contains the Response Flag and Sub-Command ID (RFSCID). The Payload may be a request (REQ) from the host to the module, a response (RSP) from the module to that request, an indication (IND) from the module to the host, and the optional confirmation (CFM) from the host for that indication.
+    /// </summary>
+    /// <returns></returns>
+    ResponseFlag GetResponseFlag();
+
+    void SetResponseFlag(const ResponseFlag flag);
+
+    // sub command id
+    SubCommandID GetSubCommandID();
+
+    /// <summary>
+    /// must call SetSubCommandID first then SetFrameID, and any other data afterwards
+    /// </summary>
+    void SetSubCommandID(const SubCommandID id) ;
+
+    /// <summary>
+    /// must call SetSubCommandID first then SetFrameID, and any other data afterwards
+    /// </summary>
+    void SetSubCommandID(const int value);
+
+    // frame id
+    char GetFrameID();
+
+    /// <summary>
+    /// must call SetSubCommandID first then SetFrameID, and any other data afterwards
+    /// </summary>
+    void SetFrameID(const char frameID);
+
+    // content
+    int GetPosition();
+
+    void SetPosition(const int position);
+
+    void Allocate(const int length);
+
+    void Rewind();
+
+    void SetContent(const char value);
+
+    void SetContent(const char * value, const int offset, const int length);
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/CreateSocketResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,17 @@
+#include "CreateSocketResponse.h"
+
+using namespace SmartLabMuRata;
+
+CreateSocketResponse::CreateSocketResponse(Payload * payload)
+    : Payload(payload)
+{ }
+
+SNICCode CreateSocketResponse::GetStatus()
+{
+    return (SNICCode)GetData()[2];
+}
+
+char CreateSocketResponse::GetSocketID()
+{
+    return GetData()[3];
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/CreateSocketResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,22 @@
+#ifndef SmartLab_MuRata_Response_CreateSocketResponse
+#define SmartLab_MuRata_Response_CreateSocketResponse
+
+#include "Payload.h"
+#include "SNICCode.h"
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class CreateSocketResponse : public Payload
+{
+public :
+    CreateSocketResponse(Payload * payload);
+
+    SNICCode GetStatus();
+
+    char GetSocketID();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/DHCPInfoResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,58 @@
+#include "DHCPInfoResponse.h"
+
+using namespace SmartLabMuRata;
+
+DHCPInfoResponse::DHCPInfoResponse(Payload * payload)
+    : Payload(payload)
+{ }
+
+SNICCode DHCPInfoResponse::GetStatus()
+{
+    return (SNICCode)GetData()[2];
+}
+
+const char * DHCPInfoResponse::GetLocalMAC()
+{
+    if (GetStatus() != SNIC_SUCCESS)
+        return NULL;
+
+    return GetData() + 3;
+}
+
+IPAddress DHCPInfoResponse::GetLocalIP()
+{
+    IPAddress ip;
+
+    if (GetStatus() != SNIC_SUCCESS)
+        return ip;
+
+    ip.SetValue(GetData(), 9);
+    return ip;
+}
+
+IPAddress DHCPInfoResponse::GetGatewayIP()
+{
+    IPAddress ip;
+
+    if (GetStatus() != SNIC_SUCCESS)
+        return ip;
+
+    ip.SetValue(GetData(), 13);
+    return ip;
+}
+
+IPAddress DHCPInfoResponse::GetSubnetMask()
+{
+    IPAddress ip;
+
+    if (GetStatus() != SNIC_SUCCESS)
+        return ip;
+
+    ip.SetValue(GetData(), 17);
+    return ip;
+}
+
+DHCPMode DHCPInfoResponse::GetDHCPMode()
+{
+    return (DHCPMode)GetData()[21];
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/DHCPInfoResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,32 @@
+#ifndef SmartLab_MuRata_Response_DHCPInfoResponse
+#define SmartLab_MuRata_Response_DHCPInfoResponse
+
+#include "Payload.h"
+#include "SNICCode.h"
+#include "IPAddress.h"
+#include "DHCPMode.h"
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class DHCPInfoResponse : public Payload
+{
+public :
+    DHCPInfoResponse(Payload * payload);
+
+    SNICCode GetStatus();
+
+    const char * GetLocalMAC();
+
+    IPAddress GetLocalIP();
+
+    IPAddress GetGatewayIP();
+
+    IPAddress GetSubnetMask();
+
+    DHCPMode GetDHCPMode();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/HTTPResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,49 @@
+#include "HTTPResponse.h"
+
+using namespace SmartLabMuRata;
+
+HTTPResponse::HTTPResponse(Payload * payload)
+    : Payload(payload)
+{
+    statusCode = GetData()[2] << 8 | GetData()[3];
+    if (statusCode >= 100) {
+        contentLength = (GetData()[4] & 0x7F) << 8 | GetData()[5];
+        contentType = string(GetData() + 6);
+        payloadOffset = 6 + contentType.length() + 1;
+    }
+}
+
+bool HTTPResponse::isMoreDataComing()
+{
+    return (GetData()[4] >> 7) == 0x01 ? true : false;
+}
+
+int HTTPResponse::GetContentLength()
+{
+    return contentLength;
+}
+
+int HTTPResponse::GetStatusCode()
+{
+    return statusCode;
+}
+
+char HTTPResponse::GetContent(int index)
+{
+    return GetData()[index + payloadOffset];
+}
+
+const char * HTTPResponse::GetContent()
+{
+    return GetData() + payloadOffset;
+}
+
+string & HTTPResponse::GetContentType()
+{
+    return contentType;
+}
+
+int HTTPResponse::GetContentOffset()
+{
+    return payloadOffset;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/HTTPResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,68 @@
+#ifndef SmartLab_MuRata_Response_HTTPResponse
+#define SmartLab_MuRata_Response_HTTPResponse
+
+#include "Payload.h"
+#include <string>
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class HTTPResponse: public Payload
+{
+private :
+    int payloadOffset;
+    int contentLength;
+    int statusCode;
+    string contentType;
+
+public :
+    HTTPResponse(Payload * payload);
+
+    /// <summary>
+    /// Present only if Status code is HTTP status code.
+    /// </summary>
+    /// <returns></returns>
+    bool isMoreDataComing();
+
+    /// <summary>
+    /// Present only if Status code is HTTP status code.
+    /// </summary>
+    /// <returns></returns>
+    int GetContentLength();
+
+    /// <summary>
+    /// Status code can be either SNIC status code (which is less than 100) listed in Table 18, or HTTP status code defined in HTTP spec 1.1 (which is bigger than 100).
+    /// </summary>
+    /// <returns></returns>
+    int GetStatusCode();
+
+    /// <summary>
+    /// Present only if Status code is HTTP status code.
+    /// </summary>
+    /// <param name="index"></param>
+    /// <returns></returns>
+    char GetContent(int index);
+
+    /// <summary>
+    /// Present only if Status code is HTTP status code.
+    /// </summary>
+    /// <param name="index"></param>
+    /// <returns></returns>
+    const char * GetContent();
+
+    /// <summary>
+    /// Present only if Status code is HTTP status code.
+    /// </summary>
+    /// <returns></returns>
+    string & GetContentType();
+
+    /// <summary>
+    /// Present only if Status code is HTTP status code.
+    /// </summary>
+    /// <returns></returns>
+    int GetContentOffset();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/InitializationResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,27 @@
+#include "InitializationResponse.h"
+
+using namespace SmartLabMuRata;
+
+InitializationResponse::InitializationResponse(Payload * payload)
+    : Payload(payload)
+{ }
+
+SNICCode InitializationResponse::GetStatus()
+{
+    return (SNICCode)GetData()[2];
+}
+
+int InitializationResponse::GetDefaultReceiveBufferSize()
+{
+    return GetData()[3] << 8 | GetData()[4];
+}
+
+int InitializationResponse::GetMaximumUDPSupported()
+{
+    return GetData()[5];
+}
+
+int InitializationResponse::GetMaximumTCPSupported()
+{
+    return GetData()[6];
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/InitializationResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,24 @@
+#ifndef SmartLab_MuRata_Response_InitializationResponse
+#define SmartLab_MuRata_Response_InitializationResponse
+
+#include "Payload.h"
+#include "SNICCode.h"
+
+namespace SmartLabMuRata
+{
+class InitializationResponse : public Payload
+{
+public :
+    InitializationResponse(Payload * payload);
+
+    SNICCode GetStatus();
+
+    int GetDefaultReceiveBufferSize();
+
+    int GetMaximumUDPSupported();
+
+    int GetMaximumTCPSupported();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/SendFromSocketResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,20 @@
+#include "SendFromSocketResponse.h"
+
+using namespace SmartLabMuRata;
+
+SendFromSocketResponse::SendFromSocketResponse(Payload * payload)
+    : Payload(payload)
+{ }
+
+SNICCode SendFromSocketResponse::GetStatus()
+{
+    return (SNICCode)GetData()[2];
+}
+
+int SendFromSocketResponse::GetNumberofBytesSent()
+{
+    if (GetStatus() == SNIC_SUCCESS)
+        return GetData()[3] << 8 | GetData()[4];
+
+    return -1;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/SendFromSocketResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,20 @@
+#ifndef SmartLab_MuRata_Response_SendFromSocketResponse
+#define SmartLab_MuRata_Response_SendFromSocketResponse
+
+#include "Payload.h"
+#include "SNICCode.h"
+
+namespace SmartLabMuRata
+{
+class SendFromSocketResponse : public Payload
+{
+public :
+    SendFromSocketResponse(Payload * payload);
+
+    SNICCode GetStatus();
+
+    int GetNumberofBytesSent();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/SocketStartReceiveResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,20 @@
+#include "SocketStartReceiveResponse.h"
+
+using namespace SmartLabMuRata;
+
+SocketStartReceiveResponse::SocketStartReceiveResponse(Payload * payload)
+    : Payload(payload)
+{ }
+
+SNICCode SocketStartReceiveResponse::GetStatus()
+{
+    return (SNICCode)GetData()[2];
+}
+
+int SocketStartReceiveResponse::GetReceiveBufferSize()
+{
+    if (GetStatus() == SNIC_SUCCESS)
+        return GetData()[3] << 8 | GetData()[4];
+
+    return -1;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/SocketStartReceiveResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,20 @@
+#ifndef SmartLab_MuRata_Response_SocketStartReceiveResponse
+#define SmartLab_MuRata_Response_SocketStartReceiveResponse
+
+#include "Payload.h"
+#include "SNICCode.h"
+
+namespace SmartLabMuRata
+{
+class SocketStartReceiveResponse : public Payload
+{
+public:
+    SocketStartReceiveResponse(Payload * payload);
+
+    SNICCode GetStatus();
+
+    int GetReceiveBufferSize();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/VersionInfoResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,23 @@
+#include "VersionInfoResponse.h"
+
+using namespace SmartLabMuRata;
+
+VersionInfoResponse::VersionInfoResponse(Payload * payload)
+    : Payload(payload)
+{ }
+
+CMDCode VersionInfoResponse::GetStatus()
+{
+    return (CMDCode)GetData()[2];
+}
+
+char VersionInfoResponse::GetVersionStringLength()
+{
+    return GetData()[3];
+}
+
+string VersionInfoResponse::GetVsersionString()
+{
+    int size = GetVersionStringLength();
+    return string(GetData() + 4, size);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/VersionInfoResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,26 @@
+#ifndef SmartLab_MuRata_Response_VersionInfoResponse
+#define SmartLab_MuRata_Response_VersionInfoResponse
+
+#include "Payload.h"
+#include "CMDCode.h"
+
+#include <string>
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class VersionInfoResponse : public Payload
+{
+public :
+    VersionInfoResponse(Payload * payload);
+
+    CMDCode GetStatus();
+
+    char GetVersionStringLength();
+
+    string GetVsersionString();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/WIFIStatusResponse.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,29 @@
+#include "WIFIStatusResponse.h"
+
+using namespace SmartLabMuRata;
+
+WIFIStatusResponse::WIFIStatusResponse(Payload * payload)
+    : Payload(payload)
+{ }
+
+WIFIStatusCode WIFIStatusResponse::GetWiFiStatusCode()
+{
+    return (WIFIStatusCode)GetData()[2];
+}
+
+const char * WIFIStatusResponse::GetMACAddress()
+{
+    if (GetWiFiStatusCode() == WIFI_OFF)
+        return NULL;
+        
+    return GetData() + 3;
+}
+
+string WIFIStatusResponse::GetSSID()
+{
+    WIFIStatusCode code = GetWiFiStatusCode();
+    if (code == STA_JOINED || code == AP_STARTED)
+        return string(GetData() + 9);
+
+    return string();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Response/WIFIStatusResponse.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,34 @@
+#ifndef SmartLab_MuRata_Response_WIFIStatusResponse
+#define SmartLab_MuRata_Response_WIFIStatusResponse
+
+#include "Payload.h"
+#include "WIFIStatusCode.h"
+
+#include <string>
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class WIFIStatusResponse :public Payload
+{
+public:
+    WIFIStatusResponse(Payload * payload);
+
+    WIFIStatusCode GetWiFiStatusCode();
+
+    /// <summary>
+    /// Present only if WiFi Status code is not WIFI_OFF.
+    /// </summary>
+    /// <returns></returns>
+    const char * GetMACAddress();
+
+    /// <summary>
+    /// Present only if WiFi Status code is STA_JOINED or AP_STARTED.
+    /// </summary>
+    /// <returns></returns>
+    string GetSSID();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/BSSType.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,13 @@
+#ifndef SmartLab_MuRata_Type_BSSType
+#define SmartLab_MuRata_Type_BSSType
+
+namespace SmartLabMuRata
+{
+enum BSSType {
+    Infrastructure = 0x00,
+    AD_Hoc = 0x01,
+    Any = 0x02,
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/CommandID.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,28 @@
+#ifndef SmartLab_MuRata_Type_CommandID
+#define SmartLab_MuRata_Type_CommandID
+
+namespace SmartLabMuRata
+{
+enum CommandID {
+    NAK = 0x00,
+
+    /// <summary>
+    /// General Management
+    /// </summary>
+    CMD_ID_GEN = 0x01,
+
+    /// <summary>
+    /// WIFI API
+    /// </summary>
+    CMD_ID_WIFI = 0x50,
+
+    /// <summary>
+    /// SNIC API
+    /// </summary>
+    CMD_ID_SNIC = 0x70,
+
+    ACK = 0x7F,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/DHCPMode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,13 @@
+#ifndef SmartLab_MuRata_Type_DHCPMode
+#define SmartLab_MuRata_Type_DHCPMode
+
+namespace SmartLabMuRata
+{
+enum DHCPMode {
+    static_IP = 0x00,
+    dynamic_IP = 0x01,
+    soft_AP = 0x02,
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/HTTPContent.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,148 @@
+#include "HTTPContent.h"
+
+using namespace SmartLabMuRata;
+
+const char HTTPContent::HEADER_SEPARATE[] = ": ";
+const char HTTPContent::HEADER_TEMINATE[] = "\r\n";
+
+HTTPContent::HTTPContent(const HTTPMethod method, const char * remoteHost,const int remotePort,const char * uri, const char timeout, const char * contentType)
+{
+    body = NULL;
+    SetMethod(method)->SetRemoteHost(remoteHost)->SetRemotePort(remotePort)->SetURI(uri)->SetTimeout(timeout)->SetContentType(contentType);
+}
+
+/*
+HTTPContent::~HTTPContent()
+{
+    delete remoteHost;
+    delete uri;
+    delete contentType;
+    delete body;
+}
+*/
+
+HTTPMethod HTTPContent::GetMethod()
+{
+    return method;
+}
+
+HTTPContent * HTTPContent::SetMethod(const HTTPMethod method)
+{
+    this->method = method;
+    return this;
+}
+
+char HTTPContent::GetTimeout()
+{
+    return timeout;
+}
+
+/// <summary>
+/// Timeout is in seconds. If Timeout is 0, it means wait forever. A complete HTTP request will block other commands until either a response is received or timeout. So timeout value of 0 is not recommended. If timeout happens, the response status code would be SNIC_TIMEOUT. If it is chunked encoding in the response, the last chunk should be received before Timeout; otherwise, the connection is closed. If the HTTP request has more data to send (POST), it is not considered a complete HTTP request, and other commands are not blocked until the series of SNIC_HTTP_MORE_REQ are finished.
+/// </summary>
+/// <param name="timeout"></param>
+/// <returns></returns>
+HTTPContent * HTTPContent::SetTimeout(const char timeout)
+{
+    this->timeout = timeout;
+    return this;
+}
+
+int HTTPContent::GetRemotePort()
+{
+    return remotePort;
+}
+
+HTTPContent * HTTPContent::SetRemotePort(const int port)
+{
+    this->remotePort = port;
+    return this;
+}
+
+string * HTTPContent::GetRemoteHost()
+{
+    return &remoteHost;
+}
+
+HTTPContent * HTTPContent::SetRemoteHost(const char * host)
+{
+    remoteHost = host;
+    return this;
+}
+
+string * HTTPContent::GetURI()
+{
+    return &uri;
+}
+
+HTTPContent * HTTPContent::SetURI(const char * uri)
+{
+    this->uri = uri;
+    return this;
+}
+
+string * HTTPContent::GetContentType()
+{
+    return &contentType;
+}
+
+HTTPContent * HTTPContent::SetContentType(const char * contentType)
+{
+    this->contentType = string(contentType);
+    return this;
+}
+
+/*
+const string * HTTPContent::GetOtherHeader(const string * key)
+{
+    if (otherHeaders.count(*key) > 0)
+        return otherHeaders[*key];
+    else return NULL;
+}*/
+
+HTTPContent * HTTPContent::SetOtherHeader(const char * key, const char * value)
+{
+    otherHeaders[key] = value;
+    return this;
+}
+
+void HTTPContent::GetOtherHeaders(string * headers)
+{
+    for (std::map<const char *, const char *>::iterator it=otherHeaders.begin(); it!=otherHeaders.end(); ++it)
+        headers->append(it->first).append(HEADER_SEPARATE).append(it->second).append(HEADER_TEMINATE);
+
+    headers->append(HEADER_TEMINATE);
+}
+
+const char * HTTPContent::GetBody()
+{
+    return body;
+}
+
+HTTPContent * HTTPContent::SetBody(char * body, int offset, int length)
+{
+    if (body == NULL)
+        contentLength = 0;
+    else
+        contentLength = length - offset;
+
+    if (this->body != NULL)
+        delete[] this->body;
+
+    this->body = new char[contentLength];
+    memcpy(this->body, body + offset, contentLength);
+    return this;
+}
+
+HTTPContent * HTTPContent::ClearBody()
+{
+    contentLength = 0;
+    delete[] body;
+    body = NULL;
+    return this;
+}
+
+int HTTPContent::GetContentLength()
+{
+    return contentLength;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/HTTPContent.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,94 @@
+#ifndef SmartLab_MuRata_Type_HTTPContent
+#define SmartLab_MuRata_Type_HTTPContent
+
+#include <string>
+#include <map>
+
+#include "HTTPMethod.h"
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class HTTPContent
+{
+private:
+    const static char HEADER_SEPARATE[];
+    const static char HEADER_TEMINATE[];
+
+    HTTPMethod method;
+    char timeout;
+    int remotePort;
+    
+    string remoteHost;
+    string uri;
+
+    int contentLength;
+    string contentType;
+
+    map<const char *, const char *> otherHeaders;
+
+    char * body;
+
+    /// <summary>
+    /// URI, Content Type, and Other header are all NUL terminated char strings. URI must be specified, e.g., “index.htm”. If Content Type is an empty string, the default will be “text/plain”. If it is a GET,
+    /// </summary>
+    /// <param name="method"></param>
+    /// <param name="remoteHost"></param>
+    /// <param name="remotePort"></param>
+    /// <param name="uri"></param>
+    /// <param name="timeout"></param>
+    /// <param name="contentType"></param>
+public :
+
+    HTTPContent(const HTTPMethod method, const char * remoteHost,const int remotePort,const char * uri,const char timeout, const char * contentType = NULL);
+
+    //~HTTPContent();
+
+    HTTPMethod GetMethod();
+
+    HTTPContent * SetMethod(const HTTPMethod method);
+
+    char GetTimeout();
+
+    /// <summary>
+    /// Timeout is in seconds. If Timeout is 0, it means wait forever. A complete HTTP request will block other commands until either a response is received or timeout. So timeout value of 0 is not recommended. If timeout happens, the response status code would be SNIC_TIMEOUT. If it is chunked encoding in the response, the last chunk should be received before Timeout; otherwise, the connection is closed. If the HTTP request has more data to send (POST), it is not considered a complete HTTP request, and other commands are not blocked until the series of SNIC_HTTP_MORE_REQ are finished.
+    /// </summary>
+    /// <param name="timeout"></param>
+    /// <returns></returns>
+    HTTPContent * SetTimeout(const char timeout);
+
+    int GetRemotePort();
+
+    HTTPContent * SetRemotePort(const int port);
+
+    string * GetRemoteHost() ;
+
+    HTTPContent * SetRemoteHost(const char * host);
+
+    string * GetURI();
+
+    HTTPContent * SetURI(const char * uri) ;
+
+    string * GetContentType();
+
+    HTTPContent * SetContentType(const char * contentType);
+
+    //const string * GetOtherHeader(const string * key);
+
+    HTTPContent * SetOtherHeader(const char * key, const char * value);
+
+    void GetOtherHeaders(string * headers);
+
+    const char * GetBody();
+
+    HTTPContent * SetBody(char * body, int offset, int length);
+
+    HTTPContent * ClearBody();
+
+    int GetContentLength();
+
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/HTTPMethod.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,12 @@
+#ifndef SmartLab_MuRata_Type_HTTPMethod
+#define SmartLab_MuRata_Type_HTTPMethod
+
+namespace SmartLabMuRata
+{
+enum HTTPMethod {
+    GET = 0x00,
+    POST = 0x01,
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/IPAddress.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,39 @@
+#include "IPAddress.h"
+
+using namespace SmartLabMuRata;
+IPAddress::IPAddress() {}
+
+IPAddress::IPAddress(const string & ip)
+{
+    int i = 0;
+    size_t last = 0;
+    size_t index = ip.find_first_of(".", last);
+    while (index != string::npos) {
+        address[i++] = atoi(ip.substr(last, index - last).c_str());
+        last = index + 1;
+        index = ip.find_first_of(".", last);
+    }
+    if (index - last > 0)
+        address[i++] = atoi(ip.substr(last, index - last).c_str());
+}
+
+void IPAddress::SetValue(const char * data, int offset)
+{
+    memcpy(address, data + offset, 4);
+}
+
+const char * IPAddress::GetValue()
+{
+    return address;
+}
+int IPAddress::GetValueLength()
+{
+    return 4;
+}
+
+string IPAddress::ToString()
+{
+    char buffer [16];
+    sprintf (buffer, "%d.%d.%d.%d", address[0], address[1], address[2], address[3]);
+    return string(buffer);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/IPAddress.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,33 @@
+#ifndef SmartLab_MuRata_Type_IPAddress
+#define SmartLab_MuRata_Type_IPAddress
+
+#include "IConfig.h"
+
+#include <string>
+#include "mbed.h"
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class IPAddress : public IConfig
+{
+private:
+    char address[4];
+
+public :
+    IPAddress();
+
+    IPAddress(const string & ip);
+
+    void SetValue(const char * data, int offset = 0);
+
+    virtual const char * GetValue();
+
+    virtual int GetValueLength();
+
+    string ToString();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/ResetCode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,15 @@
+#ifndef SmartLab_MuRata_Type_ResetCode
+#define SmartLab_MuRata_Type_ResetCode
+
+namespace SmartLabMuRata
+{
+enum ResetCode {
+    Window_Watchdog_Reset = 0x4000,
+    Independent_Watchdog_Reset = 0x2000,
+    Software_Reset = 0x1000,
+    POR_PDR_Reset = 0x0800,
+    Pin_Reset = 0x0400,
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/ResponseFlag.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,12 @@
+#ifndef SmartLab_MuRata_Type_ResponseFlag
+#define SmartLab_MuRata_Type_ResponseFlag
+
+namespace SmartLabMuRata
+{
+enum ResponseFlag {
+    Request_Indication,
+    Response_Confirmation
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/ScanType.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,13 @@
+#ifndef SmartLab_MuRata_Type_ScanType
+#define SmartLab_MuRata_Type_ScanType
+
+namespace SmartLabMuRata
+{
+
+enum ScanType {
+    Active_Scan = 0x00,
+    Passive_Scan = 0x01,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/SecurityMode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,17 @@
+#ifndef SmartLab_MuRata_Type_SecurityMode
+#define SmartLab_MuRata_Type_SecurityMode
+
+namespace SmartLabMuRata
+{
+enum SecurityMode {
+    WIFI_SECURITY_OPEN = 0x00,
+    WEP = 0x01,
+    WIFI_SECURITY_WPA_TKIP_PSK = 0x02,
+    WIFI_SECURITY_WPA2_AES_PSK = 0x04,
+    WIFI_SECURITY_WPA2_MIXED_PSK = 0x06,
+    WIFI_SECURITY_WPA_AES_PSK = 0x07,
+    NOT_SUPPORTED = 0xFF,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/SocketSentOption.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,13 @@
+#ifndef SmartLab_MuRata_Type_SocketSentOption
+#define SmartLab_MuRata_Type_SocketSentOption
+
+namespace SmartLabMuRata
+{
+enum SocketSentOption {
+    no_action = 0x00,
+    shutdown_socket_both_directions = 0x01,
+    close_socket = 0x02,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/SubCommandID.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,252 @@
+#ifndef SmartLab_MuRata_Type_SubCommandID
+#define SmartLab_MuRata_Type_SubCommandID
+
+namespace SmartLabMuRata
+{
+enum SubCommandID {
+    /// <summary>
+    /// Power up indication
+    /// </summary>
+    GEN_PWR_UP_IND = 0x00,
+
+    /// <summary>
+    /// Sleep configuration
+    /// </summary>
+    GEN_SLEEP_CFG_REQ = 0x05,
+
+    /// <summary>
+    /// Get firmware version string
+    /// </summary>
+    GEN_FW_VER_GET_REQ = 0x08,
+
+    /// <summary>
+    /// Restore NVM to factory default
+    /// </summary>
+    GEN_RESTORE_REQ = 0x09,
+
+    /// <summary>
+    /// Soft reset the module
+    /// </summary>
+    GEN_RESET_REQ = 0x0A,
+
+    /// <summary>
+    /// Configure UART interface
+    /// </summary>
+    GEN_UART_CFG_REQ = 0x0B,
+
+
+    /// <summary>
+    /// Turn on Wifi
+    /// </summary>
+    WIFI_ON_REQ = 0x00,
+
+    /// <summary>
+    /// Turn off Wifi
+    /// </summary>
+    WIFI_OFF_REQ = 0x01,
+
+    /// <summary>
+    /// Associate to a network
+    /// </summary>
+    WIFI_JOIN_REQ = 0x02,
+
+    /// <summary>
+    /// Disconnect from a network
+    /// </summary>
+    WIFI_DISCONNECT_REQ = 0x03,
+
+    /// <summary>
+    /// Get WiFi status
+    /// </summary>
+    WIFI_GET_STATUS_REQ = 0x04,
+
+    /// <summary>
+    /// Scan WiFi networks
+    /// </summary>
+    WIFI_SCAN_REQ = 0x05,
+
+    /// <summary>
+    /// Get STA signal strength (RSSI)
+    /// </summary>
+    WIFI_GET_STA_RSSI_REQ = 0x06,
+
+    /// <summary>
+    /// Soft AP on-off control
+    /// </summary>
+    WIFI_AP_CTRL_REQ = 0x07,
+
+    /// <summary>
+    /// Start WPS process
+    /// </summary>
+    WIFI_WPS_REQ = 0x08,
+
+    /// <summary>
+    /// Get clients that are associated to the soft AP.
+    /// </summary>
+    WIFI_AP_GET_CLIENT_REQ = 0x0A,
+
+    /// <summary>
+    /// Network status indication
+    /// </summary>
+    WIFI_NETWORK_STATUS_IND = 0x10,
+
+    /// <summary>
+    /// Scan result indication
+    /// </summary>
+    WIFI_SCAN_RESULT_IND = 0x11,
+
+
+
+    /// <summary>
+    /// SNIC API initialization
+    /// </summary>
+    SNIC_INIT_REQ = 0x00,
+
+    /// <summary>
+    /// SNIC API cleanup
+    /// </summary>
+    SNIC_CLEANUP_REQ = 0x01,
+
+    /// <summary>
+    /// Send from socket
+    /// </summary>
+    SNIC_SEND_FROM_SOCKET_REQ = 0x02,
+
+    /// <summary>
+    /// Close socket
+    /// </summary>
+    SNIC_CLOSE_SOCKET_REQ = 0x03,
+
+    /// <summary>
+    /// Get socket option
+    /// </summary>
+    SNIC_GETSOCKOPT_REQ = 0x05,
+
+    /// <summary>
+    /// Set socket option
+    /// </summary>
+    SNIC_SETSOCKOPT_REQ = 0x06,
+
+    /// <summary>
+    /// Get name or peer name
+    /// </summary>
+    SNIC_SOCKET_GETNAME_REQ = 0x07,
+
+    /// <summary>
+    /// Send ARP request
+    /// </summary>
+    SNIC_SEND_ARP_REQ = 0x08,
+
+    /// <summary>
+    /// Get DHCP info
+    /// </summary>
+    SNIC_GET_DHCP_INFO_REQ = 0x09,
+
+    /// <summary>
+    /// Resolve a host name to IP address
+    /// </summary>
+    SNIC_RESOLVE_NAME_REQ = 0x0A,
+
+    /// <summary>
+    /// Configure DHCP or static IP
+    /// </summary>
+    SNIC_IP_CONFIG_REQ = 0x0B,
+
+    /// <summary>
+    /// ACK configuration for data indications
+    /// </summary>
+    SNIC_DATA_IND_ACK_CONFIG_REQ = 0x0C,
+
+    /// <summary>
+    /// Create TCP socket
+    /// </summary>
+    SNIC_TCP_CREATE_SOCKET_REQ = 0x10,
+
+    /// <summary>
+    /// Create TCP connection server
+    /// </summary>
+    SNIC_TCP_CREATE_CONNECTION_REQ = 0x11,
+
+    /// <summary>
+    /// Connect to TCP server
+    /// </summary>
+    SNIC_TCP_CONNECT_TO_SERVER_REQ = 0x12,
+
+    /// <summary>
+    /// Create UDP socket
+    /// </summary>
+    SNIC_UDP_CREATE_SOCKET_REQ = 0x13,
+
+    /// <summary>
+    /// Start UDP receive on socket
+    /// </summary>
+    SNIC_UDP_START_RECV_REQ = 0x14,
+
+    /// <summary>
+    /// Send UDP packet
+    /// </summary>
+    SNIC_UDP_SIMPLE_SEND_REQ = 0x15,
+
+    /// <summary>
+    /// Send UDP packet from socket
+    /// </summary>
+    SNIC_UDP_SEND_FROM_SOCKET_REQ = 0x16,
+
+    /// <summary>
+    /// Send HTTP request
+    /// </summary>
+    SNIC_HTTP_REQ = 0x17,
+
+    /// <summary>
+    /// Send HTTP more data request
+    /// </summary>
+    SNIC_HTTP_MORE_REQ = 0x18,
+
+    /// <summary>
+    /// Send HTTPS request
+    /// </summary>
+    SNIC_HTTPS_REQ = 0x19,
+
+    /// <summary>
+    /// Create advanced TLS TCP socket
+    /// </summary>
+    SNIC_TCP_CREATE_ADV_TLS_SOCKET_REQ = 0x1A,
+
+    /// <summary>
+    /// Create simple TLS TCP socket
+    /// </summary>
+    SNIC_TCP_CREAET_SIMPLE_TLS_SOCKET_REQ = 0x1B,
+
+    /// <summary>
+    /// Connection status indication
+    /// </summary>
+    SNIC_TCP_CONNECTION_STATUS_IND = 0x20,
+
+    /// <summary>
+    /// TCP client socket indication
+    /// </summary>
+    SNIC_TCP_CLIENT_SOCKET_IND = 0x21,
+
+    /// <summary>
+    /// TCP or connected UDP packet received indication
+    /// </summary>
+    SNIC_CONNECTION_RECV_IND = 0x22,
+
+    /// <summary>
+    /// UCP packet received indication
+    /// </summary>
+    SNIC_UDP_RECV_IND = 0x23,
+
+    /// <summary>
+    /// ARP reply indication
+    /// </summary>
+    SNIC_ARP_REPLY_IND = 0x24,
+
+    /// <summary>
+    /// HTTP response indication
+    /// </summary>
+    SNIC_HTTP_RSP_IND = 0x25,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFIInfo.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,55 @@
+#include "WIFIInfo.h"
+
+using namespace SmartLabMuRata;
+
+string & WIFIInfo::GetSSID()
+{
+    return ssid;
+}
+
+SecurityMode WIFIInfo::GetSecurityMode()
+{
+    return mode;
+}
+
+char WIFIInfo::GetChannel()
+{
+    return channel;
+}
+
+WIFIInfo::WIFIInfo() { }
+
+WIFIInfo::WIFIInfo(const char * SSID, const SecurityMode securityMode)
+{
+    SetSSID(SSID)->SetSecurityMode(securityMode);
+}
+
+/*
+WIFIInfo::~WIFIInfo()
+{
+    delete ssid;
+}
+*/
+
+WIFIInfo * WIFIInfo::SetSSID(const char * SSID)
+{
+    ssid = string(SSID);
+    return this;
+}
+
+WIFIInfo * WIFIInfo::SetSecurityMode(const SecurityMode securityMode)
+{
+    this->mode = securityMode;
+    return this;
+}
+
+WIFIInfo * WIFIInfo::SetChannel(const char channel)
+{
+    this->channel = channel;
+    return this;
+}
+
+string & WIFIInfo::ToString()
+{
+    return ssid;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFIInfo.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,41 @@
+#ifndef SmartLab_MuRata_Type_WIFIInfo
+#define SmartLab_MuRata_Type_WIFIInfo
+
+#include "SecurityMode.h"
+#include <string>
+
+using namespace std;
+
+namespace SmartLabMuRata
+{
+class WIFIInfo
+{
+private :
+    char channel;
+    string ssid;
+    SecurityMode mode;
+
+public:
+    string & GetSSID();
+
+    SecurityMode GetSecurityMode();
+
+    char GetChannel();
+
+    WIFIInfo();
+
+    WIFIInfo(const char * SSID, const SecurityMode securityMode);
+    
+    //~WIFIInfo();
+
+    virtual WIFIInfo * SetSSID(const char * SSID);
+
+    virtual WIFIInfo * SetSecurityMode(const SecurityMode securityMode);
+
+    virtual WIFIInfo * SetChannel(const char channel);
+
+    string & ToString();
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFIInterface.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,12 @@
+#ifndef SmartLab_MuRata_Type_WIFIInterface
+#define SmartLab_MuRata_Type_WIFIInterface
+
+namespace SmartLabMuRata
+{
+enum WIFIInterface {
+    STA = 0x00,
+    SoftAP =0x01,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFINetwork.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,60 @@
+#include "WIFINetwork.h"
+
+using namespace SmartLabMuRata;
+
+string & WIFINetwork::GetSecurityKey()
+{
+    return key;
+}
+
+const char * WIFINetwork::GetBSSID()
+{
+    return BSSID;
+}
+
+WIFINetwork::WIFINetwork() { BSSID = NULL; }
+
+WIFINetwork::WIFINetwork(const char * SSID, const SecurityMode securityMode, const char * securityKey)
+    : WIFIInfo(SSID, securityMode)
+{
+    BSSID = NULL;
+    SetSecurityKey(securityKey);
+}
+
+WIFINetwork::~WIFINetwork()
+{
+    delete[] BSSID;
+}
+
+WIFINetwork * WIFINetwork::SetSecurityKey(const char * SecurityKey)
+{
+    key = string(SecurityKey);
+    return this;
+}
+
+WIFINetwork * WIFINetwork::SetBSSID(const char * BSSID)
+{
+    if (this->BSSID == NULL)
+        this->BSSID = new char[6];
+
+    memcpy(this->BSSID, BSSID, 6);
+    return this;
+}
+
+WIFINetwork * WIFINetwork::SetSSID(const char * SSID)
+{
+    WIFIInfo::SetSSID(SSID);
+    return this;
+}
+
+WIFINetwork * WIFINetwork::SetSecurityMode(const SecurityMode securityMode)
+{
+    WIFIInfo::SetSecurityMode(securityMode);
+    return this;
+}
+
+WIFINetwork * WIFINetwork::SetChannel(const char channel)
+{
+    WIFIInfo::SetChannel(channel);
+    return this;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFINetwork.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,38 @@
+#ifndef SmartLab_MuRata_Type_WIFINetwork
+#define SmartLab_MuRata_Type_WIFINetwork
+
+#include "WIFIInfo.h"
+#include "mbed.h"
+
+namespace SmartLabMuRata
+{
+class WIFINetwork : public WIFIInfo
+{
+private :
+    string key;
+    char * BSSID;
+
+public:
+    string & GetSecurityKey();
+
+    const char * GetBSSID();
+
+    WIFINetwork();
+
+    WIFINetwork(const char * SSID, const SecurityMode securityMode, const char * securityKey = NULL);
+    
+    ~WIFINetwork();
+
+    virtual WIFINetwork * SetSecurityKey(const char * SecurityKey);
+
+    virtual WIFINetwork * SetBSSID(const char * BSSID);
+
+    virtual WIFINetwork * SetSSID(const char * SSID);
+
+    virtual WIFINetwork * SetSecurityMode(const SecurityMode securityMode);
+
+    virtual WIFINetwork * SetChannel(const char channel);
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFINetworkDetail.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,84 @@
+#include "WIFINetworkDetail.h"
+
+using namespace SmartLabMuRata;
+
+WIFINetworkDetail::WIFINetworkDetail() { }
+
+WIFINetworkDetail::WIFINetworkDetail(const char * SSID, const SecurityMode securityMode, const BSSType networkType, const int rssi, const int maxDataRate)
+    : WIFINetwork(SSID, securityMode)
+{
+    netType = networkType;
+    this->rssi = rssi;
+    this->maxDataRate = maxDataRate;
+}
+
+int WIFINetworkDetail::GetRSSI()
+{
+    return rssi;
+}
+
+/// <summary>
+/// Max Data Rate (Mbps)
+/// </summary>
+/// <returns></returns>
+int WIFINetworkDetail::GetMaxDataRate()
+{
+    return maxDataRate;
+}
+
+BSSType WIFINetworkDetail::GetNetworkType()
+{
+    return netType;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetRSSI(const int rssi)
+{
+
+    if (rssi >> 7 == 0x01)
+        this->rssi = (~(rssi - 1) & 0x7F) * -1;
+    else
+        this->rssi = rssi;
+    return this;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetNetworkType(const BSSType networkType)
+{
+    netType = networkType;
+    return this;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetMaxDataRate(const int maxDataRate)
+{
+    this->maxDataRate = maxDataRate;
+    return this;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetSecurityKey(const char * SecurityKey)
+{
+    WIFINetwork::SetSecurityKey(SecurityKey);
+    return this;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetBSSID(const char * BSSID)
+{
+    WIFINetwork::SetBSSID(BSSID);
+    return this;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetSSID(const char * SSID)
+{
+    WIFINetwork::SetSSID(SSID);
+    return this;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetSecurityMode(const SecurityMode securityMode)
+{
+    WIFINetwork::SetSecurityMode(securityMode);
+    return this;
+}
+
+WIFINetworkDetail * WIFINetworkDetail::SetChannel(const char channel)
+{
+    WIFINetwork::SetChannel(channel);
+    return this;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFINetworkDetail.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,51 @@
+#ifndef SmartLab_MuRata_Type_WIFINetworkDetail
+#define SmartLab_MuRata_Type_WIFINetworkDetail
+
+#include "WIFINetwork.h"
+#include "BSSType.h"
+
+namespace SmartLabMuRata
+{
+class WIFINetworkDetail : public WIFINetwork
+{
+private:
+    int rssi;
+    BSSType netType;
+    // Max Data Rate (Mbps)
+    int maxDataRate;
+
+public :
+    WIFINetworkDetail();
+
+    WIFINetworkDetail(const char * SSID, const SecurityMode securityMode, const BSSType networkType, const int rssi, const int maxDataRate);
+
+    int GetRSSI();
+
+    /// <summary>
+    /// Max Data Rate (Mbps)
+    /// </summary>
+    /// <returns></returns>
+    int GetMaxDataRate();
+
+    BSSType GetNetworkType();
+
+    WIFINetworkDetail * SetRSSI(const int rssi);
+
+    WIFINetworkDetail * SetNetworkType(const BSSType networkType) ;
+
+    WIFINetworkDetail * SetMaxDataRate(const int maxDataRate);
+
+    virtual WIFINetworkDetail * SetSecurityKey(const char * SecurityKey);
+
+    virtual WIFINetworkDetail * SetBSSID(const char * BSSID);
+
+    virtual WIFINetworkDetail * SetSSID(const char * SSID);
+
+    virtual WIFINetworkDetail * SetSecurityMode(const SecurityMode securityMode);
+
+    virtual WIFINetworkDetail * SetChannel(const char channel);
+
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WIFIStatusCode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,14 @@
+#ifndef SmartLab_MuRata_Type_WIFIStatusCode
+#define SmartLab_MuRata_Type_WIFIStatusCode
+
+namespace SmartLabMuRata
+{
+enum WIFIStatusCode {
+    WIFI_OFF = 0x00,
+    NO_NETWORK = 0x01,
+    STA_JOINED = 0x02,
+    AP_STARTED = 0x03,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Type/WPSMode.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,12 @@
+#ifndef SmartLab_MuRata_Type_WPSMode
+#define SmartLab_MuRata_Type_WPSMode
+
+namespace SmartLabMuRata
+{
+enum WPSMode {
+    Push_Button = 0x00,
+    Pin = 0x01,
+};
+}
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/UARTFrame.cpp	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,96 @@
+#include "UARTFrame.h"
+
+using namespace SmartLabMuRata;
+
+char UARTFrame::GetL0()
+{
+    return l0;
+}
+
+void UARTFrame::SetL0(const int value)
+{
+    l0 = value & 0x7F;
+}
+
+char UARTFrame::GetL1()
+{
+    return l1;
+}
+
+void UARTFrame::SetL1(const int value)
+{
+    l1 = value & 0x3F;
+
+    if ((value & 0x40) == 0x40)
+        needACK = true;
+    else needACK = false;
+}
+
+int UARTFrame::GetPayloadLength()
+{
+    return (l1 << 7) | l0;
+}
+
+void UARTFrame::SetPayloadLength(const int length)
+{
+    SetL0(length);
+    SetL1(length >> 7);
+}
+
+// ack
+bool UARTFrame::GetACKRequired()
+{
+    return needACK;
+}
+
+void UARTFrame::SetACKRequired(const bool ack)
+{
+    needACK = ack;
+}
+
+//command id
+CommandID UARTFrame::GetCommandID()
+{
+    return commandid;
+}
+
+void UARTFrame::SetCommandID(const CommandID id)
+{
+    commandid = id;
+}
+
+void UARTFrame::SetCommandID(const int value)
+{
+    commandid = (CommandID)(value & 0x7F);
+}
+
+// payload
+void UARTFrame::SetPayload(Payload * payload)
+{
+    this->payload = payload;
+    SetPayloadLength(payload->GetPosition());
+    SetChecksum(l0 + (needACK ? l1 | 0x40 : l1) + commandid);
+}
+
+Payload * UARTFrame::GetPayload()
+{
+    return payload;
+}
+
+// checksum
+char UARTFrame::GetChecksum()
+{
+    return checksum;
+}
+
+void UARTFrame::SetChecksum(const int checksum)
+{
+    this->checksum = checksum & 0x7F;
+}
+
+bool UARTFrame::VerifyChecksum()
+{
+    if (((l0 + (needACK ? l1 | 0x40 : l1) + commandid) & 0x7F) == checksum)
+        return true;
+    return false;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/UARTFrame.h	Tue Feb 03 21:24:15 2015 +0000
@@ -0,0 +1,96 @@
+#ifndef SmartLab_MuRata_UARTFrame
+#define SmartLab_MuRata_UARTFrame
+
+#include "Payload.h"
+#include "CommandID.h"
+
+namespace SmartLabMuRata
+{
+/*
+ * 7 | 6 | 5 4 3 2 1 0
+ *         SOM(0x02)
+ * 1 |       L0
+ * 1 | A |    L1
+ * 1 |   Command ID
+ *       Payload
+ *       ...
+ *       ...
+ * 1 |   Checksum
+ *         EOM(0x04)
+ */
+
+/*
+ * Each frame is delineated by a Start of Message (SOM) and End of Message (EOM) byte. The rest of the
+ * fields are as follows:
+ * The frame starts with a SOM (0x02) and ends with an EOM (0x04). The SOM and EOM values
+ * may also appear in application payload.
+ * Payload length (L1:L0): octet length of application payload including any escape characters. L0
+ * stands for bit0 to bit6, and L1 stands for bit7 to bit12 of the payload length.
+ * Command ID: specifies types of payload
+ * A: 1 if ACK required, 0 if no ACK is required. If A=1, then the receiver must send ACK upon a
+ * successful validation of the frame. A frame requiring acknowledgement must be acknowledged
+ * Murata SW Design
+ * Murata Proprietary Page 11 of 101
+ * before any other non-response frame may be transmitted, i.e., a command response is always permitted.
+ * Checksum: sum of L0, A | L1 and command ID.
+ */
+class UARTFrame
+{
+
+private :
+    char l0;
+    char l1;
+
+    bool needACK;
+
+    CommandID commandid;
+
+    Payload * payload;
+
+    char checksum;
+
+public :
+
+    static const char SOM = 0x02;
+    static const char EOM = 0x04;
+
+    // length
+    char GetL0();
+
+    void SetL0(const int value);
+
+    char GetL1();
+
+    void SetL1(const int value);
+
+    int GetPayloadLength();
+
+    void SetPayloadLength(const int length);
+
+    // ack
+    bool GetACKRequired();
+
+    void SetACKRequired(const bool ack);
+
+    //command id
+    CommandID GetCommandID();
+
+    void SetCommandID(const CommandID id);
+
+    void SetCommandID(const int value);
+
+    // payload
+    void SetPayload(Payload * payload);
+
+    Payload * GetPayload();
+
+    // checksum
+    char GetChecksum();
+
+    void SetChecksum(const int checksum);
+
+    bool VerifyChecksum();
+};
+}
+
+#endif
\ No newline at end of file