mbed socket API

Dependents:   EthernetInterface EthernetInterface_RSF EthernetInterface EthernetInterface ... more

Deprecated

This is an mbed 2 sockets library. For mbed 5, network sockets have been revised to better support additional network stacks and thread safety here.

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Tue Jun 26 15:32:12 2012 +0000
Parent:
0:1f77255a22f5
Child:
2:b227d242f3c7
Commit message:
Changed data type from uint8_t* to char*

Changed in this revision

TCPSocket.cpp Show annotated file Show diff for this revision Revisions of this file
TCPSocket.h Show annotated file Show diff for this revision Revisions of this file
UDPSocket.cpp Show annotated file Show diff for this revision Revisions of this file
UDPSocket.h Show annotated file Show diff for this revision Revisions of this file
--- a/TCPSocket.cpp	Tue Jun 26 13:16:26 2012 +0000
+++ b/TCPSocket.cpp	Tue Jun 26 15:32:12 2012 +0000
@@ -152,7 +152,7 @@
 }
 
 // -1 if unsuccessful, else number of bytes written
-int TCPSocket::send(uint8_t* data, int length, int timeout)
+int TCPSocket::send(char* data, int length, int timeout)
 {
   if( m_sock < 0 )
   {
@@ -203,7 +203,7 @@
 }
 
 // -1 if unsuccessful, else number of bytes received
-int TCPSocket::receive(uint8_t* data, int length, int timeout)
+int TCPSocket::receive(char* data, int length, int timeout)
 {
   if( m_sock < 0 )
   {
--- a/TCPSocket.h	Tue Jun 26 13:16:26 2012 +0000
+++ b/TCPSocket.h	Tue Jun 26 15:32:12 2012 +0000
@@ -19,8 +19,6 @@
 #ifndef TCPSOCKET_H
 #define TCPSOCKET_H
 
-#include <cstdint>
-
 #include "bsd_socket.h"
 
 /**
@@ -72,7 +70,7 @@
     \param timeout The maximum amount of time in ms to wait while trying to send the buffer.
     \return the number of written bytes on success (>=0) or -1 on failure
     */
-    int send(std::uint8_t* data, int length, int timeout = 0);
+    int send(char* data, int length, int timeout = 0);
 
     /** Receive data from the remote host.
     \param data The buffer in which to store the data received from the host.
@@ -80,7 +78,7 @@
     \param timeout The maximum amount of time in ms to wait while trying to receive data.
     \return the number of received bytes on success (>=0) or -1 on failure
     */
-    int receive(std::uint8_t* data, int length, int timeout = 0);
+    int receive(char* data, int length, int timeout = 0);
 
     /** Close the socket.
     */
--- a/UDPSocket.cpp	Tue Jun 26 13:16:26 2012 +0000
+++ b/UDPSocket.cpp	Tue Jun 26 15:32:12 2012 +0000
@@ -58,7 +58,7 @@
 }
 
 // -1 if unsuccessful, else number of bytes written
-int UDPSocket::sendTo(uint8_t* data, int length, char* host, int port, int timeout)
+int UDPSocket::sendTo(char* data, int length, char* host, int port, int timeout)
 {
   if( m_sock < 0 )
   {
@@ -119,7 +119,7 @@
 }
 
 // -1 if unsuccessful, else number of bytes received
-int UDPSocket::receiveFrom(uint8_t* data, int length, char** host, int* port, int timeout)
+int UDPSocket::receiveFrom(char* data, int length, char** host, int* port, int timeout)
 {
   if( m_sock < 0 )
   {
--- a/UDPSocket.h	Tue Jun 26 13:16:26 2012 +0000
+++ b/UDPSocket.h	Tue Jun 26 15:32:12 2012 +0000
@@ -49,7 +49,7 @@
     \param timeout The maximum amount of time in ms to wait while trying to send the buffer.
     \return the number of written bytes on success (>=0) or -1 on failure
     */
-    int sendTo(std::uint8_t* data, int length, char* host, int port, int timeout = 0);
+    int sendTo(char* data, int length, char* host, int port, int timeout = 0);
 
     /** Receive data from a remote host.
     \param data The buffer in which to store the data received from the host.
@@ -59,7 +59,7 @@
     \param timeout The maximum amount of time in ms to wait while trying to receive data.
     \return the number of received bytes on success (>=0) or -1 on failure
     */
-    int receiveFrom(std::uint8_t* data, int length, char** host, int* port, int timeout = 0);
+    int receiveFrom(char* data, int length, char** host, int* port, int timeout = 0);
 
     /** Close the socket.
     */