Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

Revision:
17:7268f365676b
Parent:
16:7f1d6d359787
Child:
21:17bb3eddcbae
--- a/SocketInterface.h	Wed Aug 13 04:41:04 2014 -0700
+++ b/SocketInterface.h	Sat Aug 23 05:39:17 2014 -0700
@@ -29,7 +29,7 @@
 #pragma once
 
 #include "Wiconnect.h"
-#include "types/Socket.h"
+#include "types/WiconnectSocket.h"
 #include "types/SocketIrqHandlerMap.h"
 
 
@@ -113,7 +113,7 @@
      *
      * This is the base method used by all the other connect methods.
      *
-     * @param[out] socket @ref Socket object of opened connection.
+     * @param[out] socket @ref WiconnectSocket object of opened connection.
      * @param[in] type The @ref SocketType of connection to open
      * @param[in] host The host/IP address of the remote server
      * @param[in] remortPort The port of the remote server
@@ -122,7 +122,7 @@
      * @param[in] irqPin Data available external interrupt pin. See registerSocketIrqHandler() for more info
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult connect(Socket &socket, SocketType type, const char *host, uint16_t remortPort, uint16_t localPort, const void *args, Pin irqPin);
+    WiconnectResult connect(WiconnectSocket &socket, SocketType type, const char *host, uint16_t remortPort, uint16_t localPort, const void *args, Pin irqPin);
 
 
     // ------------------------------------------------------------------------
@@ -132,13 +132,13 @@
      *
      * @brief Connect to remote TCP server.
      *
-     * @param[out] socket TCP @ref Socket object of opened connection.
+     * @param[out] socket TCP @ref WiconnectSocket object of opened connection.
      * @param[in] host The host/IP address of the remote TCP server
      * @param[in] remortPort The port of the remote server
      * @param[in] irqPin Optional, Data available external interrupt pin. See registerSocketIrqHandler() for more info
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult tcpConnect(Socket &socket, const char *host, uint16_t remortPort, Pin irqPin = NC);
+    WiconnectResult tcpConnect(WiconnectSocket &socket, const char *host, uint16_t remortPort, Pin irqPin = NC);
 
 
     // ------------------------------------------------------------------------
@@ -148,14 +148,14 @@
      *
      * @brief Connect to remote TLS server.
      *
-     * @param[out] socket TLS @ref Socket object of opened connection.
+     * @param[out] socket TLS @ref WiconnectSocket object of opened connection.
      * @param[in] host The host/IP address of the remote TLS server
      * @param[in] remortPort The port of the remote server
      * @param[in] certFilename Optional, filename of certificate on module's file system
      * @param[in] irqPin Optional, Data available external interrupt pin. See registerSocketIrqHandler() for more info
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult tlsConnect(Socket &socket, const char *host, uint16_t remortPort, const char *certFilename = NULL, Pin irqPin = NC);
+    WiconnectResult tlsConnect(WiconnectSocket &socket, const char *host, uint16_t remortPort, const char *certFilename = NULL, Pin irqPin = NC);
 
 
     // ------------------------------------------------------------------------
@@ -165,14 +165,14 @@
      *
      * @brief Connect to remote UDP server.
      *
-     * @param[out] socket UDP @ref Socket object of opened connection.
+     * @param[out] socket UDP @ref WiconnectSocket object of opened connection.
      * @param[in] host The host/IP address of the remote UDP server
      * @param[in] remortPort The port of the remote server
      * @param[in] localPort Optional, port of module's side of the connection
      * @param[in] irqPin Optional, Data available external interrupt pin. See registerSocketIrqHandler() for more info
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult udpConnect(Socket &socket, const char *host, uint16_t remortPort, uint16_t localPort = SOCKET_ANY_PORT, Pin irqPin = NC);
+    WiconnectResult udpConnect(WiconnectSocket &socket, const char *host, uint16_t remortPort, uint16_t localPort = SOCKET_ANY_PORT, Pin irqPin = NC);
 
 
     // ------------------------------------------------------------------------
@@ -194,12 +194,12 @@
      * @note If the URL starts with 'https://' and no certificate filename is specified,
      *       the module's default certificate is used.
      *
-     * @param[out] socket HTTP @ref Socket object of opened connection.
+     * @param[out] socket HTTP @ref WiconnectSocket object of opened connection.
      * @param[in] url URL of HTTP request
      * @param[in] args Configuration @ref HttpSocketArgs for HTTP connection
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult httpConnect(Socket &socket, const char *url, const HttpSocketArgs *args);
+    WiconnectResult httpConnect(WiconnectSocket &socket, const char *url, const HttpSocketArgs *args);
 
     /**
      * @ingroup api_socket_http
@@ -212,13 +212,13 @@
      * additional headers to the request.
      * Use httpGetStatus() to issue the HTTP request and receive the HTTP response.
      *
-     * @param[out] socket HTTP @ref Socket object of opened connection.
+     * @param[out] socket HTTP @ref WiconnectSocket object of opened connection.
      * @param[in] url URL of HTTP GET request
      * @param[in] openOnly Optional, if TRUE this will only open a connection to the server (it won't issue the request)
      * @param[in] certFilename Optional, filename of existing TLS certificate on module's file system. See @ref secure_http_connection
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult httpGet(Socket &socket, const char *url, bool openOnly = false, const char *certFilename = NULL);
+    WiconnectResult httpGet(WiconnectSocket &socket, const char *url, bool openOnly = false, const char *certFilename = NULL);
 
     /**
      * @ingroup api_socket_http
@@ -227,37 +227,37 @@
      *
      * This method has the open to only 'open' the connection which enabled by default. This means a connection
      * to the remote HTTP server is opened, but the HTTP request isn't issued. This
-     * allow for addition data to be added to the request. Use the returned @ref Socket object's 'write' methods
+     * allow for addition data to be added to the request. Use the returned @ref WiconnectSocket object's 'write' methods
      * to add POST data to the request.
      * When all POST data has been written, use httpGetStatus() to issue the HTTP request and receive the HTTP response.
      *
-     * @param[out] socket HTTP @ref Socket object of opened connection.
+     * @param[out] socket HTTP @ref WiconnectSocket object of opened connection.
      * @param[in] url URL of HTTP POST request
      * @param[in] contextType The value to go into the 'content-type' HTTP header (e.g. 'application/json')
      * @param[in] openOnly Optional, if FALSE this will immediately issue the POST request.
      * @param[in] certFilename Optional, filename of existing TLS certificate on module's file system. See @ref secure_http_connection
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult httpPost(Socket &socket, const char *url, const char *contextType, bool openOnly = true, const char *certFilename = NULL);
+    WiconnectResult httpPost(WiconnectSocket &socket, const char *url, const char *contextType, bool openOnly = true, const char *certFilename = NULL);
 
     /**
      * @ingroup api_socket_http
      *
      * @brief Issue HTTP HEAD Request
      *
-     * @param[out] socket HTTP @ref Socket object of opened connection.
+     * @param[out] socket HTTP @ref WiconnectSocket object of opened connection.
      * @param[in] url URL of HTTP HEAD request
      * @param[in] certFilename Optional, filename of existing TLS certificate on module's file system. See @ref secure_http_connection
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult httpHead(Socket &socket, const char *url, const char *certFilename = NULL);
+    WiconnectResult httpHead(WiconnectSocket &socket, const char *url, const char *certFilename = NULL);
 
     /**
      * @ingroup api_socket_http
      *
      * @brief Add HTTP header key/value pair to opened HTTP request.
      *
-     * To use this function, the supplied @ref Socket parameter must have been created
+     * To use this function, the supplied @ref WiconnectSocket parameter must have been created
      * using either httpGet() or httpPost() and the 'openOnly' parameter TRUE.
      *
      * This will add additional header to the HTTP request.
@@ -269,7 +269,7 @@
      * @param[in] value Header value (e.g. 'application/json')
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult httpAddHeader(Socket &socket, const char *key, const char *value);
+    WiconnectResult httpAddHeader(WiconnectSocket &socket, const char *key, const char *value);
 
     /**
      * @ingroup api_socket_http
@@ -283,7 +283,7 @@
      * @param[out] statusCodePtr Pointer to uint32 to hold http status code
      * @return Result of method. See @ref WiconnectResult
      */
-    WiconnectResult httpGetStatus(Socket &socket, uint32_t *statusCodePtr);
+    WiconnectResult httpGetStatus(WiconnectSocket &socket, uint32_t *statusCodePtr);
 
 protected:
     SocketInterface(Wiconnect *wiconnect);