NetworkSocketAPI
Dependents: HelloWizFi250Interface
Fork of NetworkSocketAPI by
Revision 57:3c873fab4207, committed 2016-02-25
- Comitter:
- Christopher Haster
- Date:
- Thu Feb 25 19:00:39 2016 -0600
- Parent:
- 56:19c9e332c0f1
- Child:
- 58:1caa187fa5af
- Commit message:
- Standardized prefix to NS for enums and constants
Changed in this revision
--- a/NetworkInterface.h Mon Feb 29 15:23:24 2016 +0000 +++ b/NetworkInterface.h Thu Feb 25 19:00:39 2016 -0600 @@ -115,10 +115,10 @@ friend class Socket; /** Internally create a socket - * @param proto The type of socket to open, SOCK_TCP or SOCK_UDP + * @param proto The type of socket to open, NS_TCP or NS_UDP * @return The allocated socket */ - virtual SocketInterface *createSocket(socket_protocol_t proto) = 0; + virtual SocketInterface *createSocket(ns_protocol_t proto) = 0; /** Internally destroy a socket * @param socket An allocated SocketInterface
--- a/Socket.cpp Mon Feb 29 15:23:24 2016 +0000 +++ b/Socket.cpp Thu Feb 25 19:00:39 2016 -0600 @@ -17,7 +17,7 @@ #include "Socket.h" #include <string.h> -Socket::Socket(NetworkInterface *iface, socket_protocol_t proto) +Socket::Socket(NetworkInterface *iface, ns_protocol_t proto) : _iface(iface) , _proto(proto) , _socket(0)
--- a/Socket.h Mon Feb 29 15:23:24 2016 +0000 +++ b/Socket.h Thu Feb 25 19:00:39 2016 -0600 @@ -90,11 +90,11 @@ protected: - Socket(NetworkInterface *iface, socket_protocol_t proto); + Socket(NetworkInterface *iface, ns_protocol_t proto); private: NetworkInterface *_iface; - socket_protocol_t _proto; + ns_protocol_t _proto; SocketInterface *_socket; char _ip_address[NS_IP_SIZE];
--- a/SocketInterface.h Mon Feb 29 15:23:24 2016 +0000 +++ b/SocketInterface.h Thu Feb 25 19:00:39 2016 -0600 @@ -22,9 +22,9 @@ /** Enum of socket protocols */ -enum socket_protocol_t { - SOCK_TCP, /*!< Socket connection over TCP */ - SOCK_UDP, /*!< Socket connection over UDP */ +enum ns_protocol_t { + NS_TCP, + NS_UDP, };
--- a/TCPSocket.h Mon Feb 29 15:23:24 2016 +0000 +++ b/TCPSocket.h Thu Feb 25 19:00:39 2016 -0600 @@ -33,7 +33,7 @@ * @param port Optional port to connect to */ TCPSocket(NetworkInterface *iface) - : Socket(iface, SOCK_TCP) + : Socket(iface, NS_TCP) { } };
--- a/UDPSocket.h Mon Feb 29 15:23:24 2016 +0000 +++ b/UDPSocket.h Thu Feb 25 19:00:39 2016 -0600 @@ -33,7 +33,7 @@ * @param port Optional port to connect to */ UDPSocket(NetworkInterface *iface) - : Socket(iface, SOCK_UDP) + : Socket(iface, NS_UDP) { } };
--- a/WiFiInterface.h Mon Feb 29 15:23:24 2016 +0000 +++ b/WiFiInterface.h Thu Feb 25 19:00:39 2016 -0600 @@ -21,11 +21,11 @@ /** Enum for WiFi encryption types */ -enum wifi_security_t { - WI_NONE = 0, /*!< No security for connection */ - WI_WEP, /*!< WEP encryption */ - WI_WPA, /*!< WPA encryption */ - WI_WPA2, /*!< WPA2 encryption */ +enum ns_security_t { + NS_SECURITY_NONE = 0, + NS_SECURITY_WEP, + NS_SECURITY_WPA, + NS_SECURITY_WPA2, }; @@ -44,7 +44,7 @@ virtual int32_t connect( const char *ssid, const char *pass, - wifi_security_t security = WI_NONE) = 0; + ns_security_t security = NS_SECURITY_NONE) = 0; /** Stop the interface * @return 0 on success