Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of C027_Support by
Diff: MDM.h
- Revision:
- 63:42cb563a25bc
- Parent:
- 59:382695f1ce85
- Child:
- 66:69072b3c5bca
diff -r 1f65abb842be -r 42cb563a25bc MDM.h
--- a/MDM.h Tue May 13 07:13:27 2014 +0000
+++ b/MDM.h Tue May 13 12:31:33 2014 +0000
@@ -146,11 +146,12 @@
//! Socket error return codes
#define SOCKET_ERROR -1
- /** Create a socket for a ip protocol
+ /** Create a socket for a ip protocol (and optionaly bind)
\param ipproto the protocol (UDP or TCP)
+ \param port in case of UDP, this optional port where it is bind
\return the socket handle if successful or SOCKET_ERROR on failure
*/
- int socketSocket(IpProtocol ipproto);
+ int socketSocket(IpProtocol ipproto, int port = -1);
/** make a socket connection
\param socket the socket handle
@@ -207,12 +208,13 @@
/** Read from this socket
\param socket the socket handle
+ \param ip the ip of host where the data originates from
+ \param port the port where the data originates from
\param buf the buffer to read into
\param len the size of the buffer to read into
- \param ip the ip of host where the data originates from
\return the number of bytes read or SOCKET_ERROR on failure
*/
- int socketRecvFrom(int socket, char* buf, int len, IP* ip);
+ int socketRecvFrom(int socket, IP* ip, int* port, char* buf, int len);
/** Close a connectied socket (that was connected with #socketConnect)
\param socket the socket handle
