PHS module APM-002 library. see: https://developer.mbed.org/users/phsfan/notebook/abitusbmodem/
Dependencies: Socket lwip-sys lwip
Fork of AbitUSBModem by
socket.h
00001 /* socket.h */ 00002 /* Copyright (C) 2012 mbed.org, MIT License 00003 * 00004 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 00005 * and associated documentation files (the "Software"), to deal in the Software without restriction, 00006 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 00007 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 00008 * furnished to do so, subject to the following conditions: 00009 * 00010 * The above copyright notice and this permission notice shall be included in all copies or 00011 * substantial portions of the Software. 00012 * 00013 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 00014 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00015 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00016 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00017 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00018 */ 00019 00020 00021 #ifndef SYS_SOCKET_H_ 00022 #define SYS_SOCKET_H_ 00023 00024 #include "lwip/sockets.h" 00025 00026 //Sockets 00027 00028 inline int accept(int s, struct sockaddr *addr, socklen_t *addrlen) 00029 { 00030 return lwip_accept(s, addr, addrlen); 00031 } 00032 00033 inline int bind(int s, const struct sockaddr *name, socklen_t namelen) 00034 { 00035 return lwip_bind(s, name, namelen); 00036 } 00037 00038 inline int shutdown(int s, int how) 00039 { 00040 return lwip_shutdown(s, how); 00041 } 00042 00043 inline int getsockname (int s, struct sockaddr *name, socklen_t *namelen) 00044 { 00045 return lwip_getsockname(s, name, namelen); 00046 } 00047 00048 inline int getpeername (int s, struct sockaddr *name, socklen_t *namelen) 00049 { 00050 return lwip_getpeername(s, name, namelen); 00051 } 00052 00053 inline int getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen) 00054 { 00055 return lwip_getsockopt(s, level, optname, optval, optlen); 00056 } 00057 00058 inline int setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen) 00059 { 00060 return lwip_setsockopt(s, level, optname, optval, optlen); 00061 } 00062 00063 inline int connect(int s, const struct sockaddr *name, socklen_t namelen) 00064 { 00065 return lwip_connect(s, name, namelen); 00066 } 00067 00068 inline int listen(int s, int backlog) 00069 { 00070 return lwip_listen(s, backlog); 00071 } 00072 00073 inline int recv(int s, void *mem, size_t len, int flags) 00074 { 00075 return lwip_recv(s, mem, len, flags); 00076 } 00077 00078 inline int recvfrom(int s, void *mem, size_t len, int flags, 00079 struct sockaddr *from, socklen_t *fromlen) 00080 { 00081 return lwip_recvfrom(s, mem, len, flags, from, fromlen); 00082 } 00083 00084 inline int send(int s, const void *dataptr, size_t size, int flags) 00085 { 00086 return lwip_send(s, dataptr, size, flags); 00087 } 00088 00089 inline int sendto(int s, const void *dataptr, size_t size, int flags, 00090 const struct sockaddr *to, socklen_t tolen) 00091 { 00092 return lwip_sendto(s, dataptr, size, flags, to, tolen); 00093 } 00094 00095 inline int socket(int domain, int type, int protocol) 00096 { 00097 return lwip_socket(domain, type, protocol); 00098 } 00099 00100 inline int select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, 00101 struct timeval *timeout) 00102 { 00103 return lwip_select(maxfdp1, readset, writeset, exceptset, timeout); 00104 } 00105 00106 inline int ioctlsocket(int s, long cmd, void *argp) 00107 { 00108 return lwip_ioctl(s, cmd, argp); 00109 } 00110 00111 inline int read(int s, void *mem, size_t len) 00112 { 00113 return lwip_read(s, mem, len); 00114 } 00115 00116 inline int write(int s, const void *dataptr, size_t size) 00117 { 00118 return lwip_write(s, dataptr, size); 00119 } 00120 00121 inline int close(int s) 00122 { 00123 return lwip_close(s); 00124 } 00125 00126 #endif /* SYS_SOCKET_H_ */
Generated on Wed Jul 13 2022 04:34:32 by 1.7.2