 |
F´ Flight Software - C/C++ Documentation
NASA-v2.0.1
A framework for building embedded system applications to NASA flight quality standards.
|
Go to the documentation of this file.
12 #ifndef DRV_IP_IPHELPER_HPP_
13 #define DRV_IP_IPHELPER_HPP_
67 const U32 send_timeout_microseconds);
165 virtual I32
sendProtocol(
const U8*
const data,
const U32 size) = 0;
SocketIpStatus open(void)
open the IP socket for communications
@ SOCK_SUCCESS
Socket operation successful.
@ SOCK_INTERRUPTED_TRY_AGAIN
Interrupted status for retries.
@ SOCK_FAILED_TO_SET_SOCKET_OPTIONS
Failed to configure socket.
SocketIpStatus configure(const char *hostname, const U16 port, const U32 send_timeout_seconds, const U32 send_timeout_microseconds)
configure the ip socket with host and transmission timeouts
virtual SocketIpStatus openProtocol(NATIVE_INT_TYPE &fd)=0
Protocol specific open implementation, called from open.
SocketIpStatus setupTimeouts(NATIVE_INT_TYPE socketFd)
setup the socket timeout properties of the opened outgoing socket
uint8_t U8
8-bit unsigned integer
@ SOCK_FAILED_TO_CONNECT
Failed to connect socket.
Helper base-class for setting up Berkley sockets.
virtual I32 sendProtocol(const U8 *const data, const U32 size)=0
Protocol specific implementation of send. Called directly with retry from send.
@ SOCK_FAILED_TO_ACCEPT
Failed to accept connection.
@ SOCK_INVALID_IP_ADDRESS
Bad IP address supplied.
char m_hostname[SOCKET_MAX_HOSTNAME_SIZE]
Hostname to supply.
@ SOCK_FAILED_TO_LISTEN
Failed to listen on socket.
U32 m_timeoutMicroseconds
virtual I32 recvProtocol(U8 *const data, const U32 size)=0
Protocol specific implementation of recv. Called directly with error handling from recv.
@ SOCK_FAILED_TO_GET_SOCKET
Socket open failed.
bool m_open
Have we successfully opened.
@ SOCK_FAILED_TO_GET_HOST_IP
Host IP lookup failed.
SocketIpStatus send(const U8 *const data, const U32 size)
send data out the IP socket from the given buffer
SocketIpStatus
Status enumeration for socket return values.
@ SOCK_FAILED_TO_BIND
Failed to bind to socket.
Declares ISF basic types.
static SocketIpStatus addressToIp4(const char *address, void *ip4)
converts a given address in dot form x.x.x.x to an ip address. ONLY works for IPv4.
@ SOCK_READ_ERROR
Failed to read socket.
SocketIpStatus recv(U8 *const data, I32 &size)
receive data from the IP socket from the given buffer
@ SOCK_DISCONNECTED
Failed to read socket with disconnect.
@ SOCKET_MAX_HOSTNAME_SIZE
@ SOCK_SEND_ERROR
Failed to send after configured retries.
U16 m_port
IP address port used.
int NATIVE_INT_TYPE
native integer type declaration
void close(void)
closes the socket
bool isOpened(void)
check if IP socket has previously been opened