root/branches/follower/wiz810mj/src/lib/socket.h

Revision 50, 1.1 KB (checked in by follower, 14 months ago)

Make functions visible to C++ code in Arduino.

Line 
1/*
2*
3@file       socket.h
4@brief  define function of socket API
5*
6*/
7
8#ifndef _SOCKET_H_
9#define _SOCKET_H_
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15extern uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag); // Opens a socket(TCP or UDP or IP_RAW mode)
16extern void close(SOCKET s); // Close socket
17extern uint8 connect(SOCKET s, uint8 * addr, uint16 port); // Establish TCP connection (Active connection)
18extern void disconnect(SOCKET s); // disconnect the connection
19extern uint8 listen(SOCKET s);  // Establish TCP connection (Passive connection)
20extern uint16 send(SOCKET s, const uint8 * buf, uint16 len); // Send data (TCP)
21extern uint16 recv(SOCKET s, uint8 * buf, uint16 len);  // Receive data (TCP)
22extern uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port); // Send data (UDP/IP RAW)
23extern uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16  *port); // Receive data (UDP/IP RAW)
24
25extern uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len);
26
27#ifdef __cplusplus
28} // extern "C"
29#endif
30
31#endif
32/* _SOCKET_H_ */
Note: See TracBrowser for help on using the browser.