18#define MAXIMUM_SIZE 0x7FFFFFFF
69 Fw::Logger::logMsg(
"[WARNING] Failed to open port with status %d and errno %d\n", status, errno);
78 I32 size =
static_cast<I32
>(buffer.
getSize());
82 Fw::Logger::logMsg(
"[WARNING] Failed to recv from port with status %d and errno %d\n", status, errno);
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
PlatformUIntType NATIVE_UINT_TYPE
@ SOCKET_RETRY_INTERVAL_MS
void close()
closes the socket
bool isOpened()
check if IP socket has previously been opened
SocketIpStatus recv(U8 *const data, I32 &size)
receive data from the IP socket from the given buffer
SocketIpStatus open()
open the IP socket for communications
supports a task to read a given socket adaptation
virtual void connected()=0
called when the IPv4 system has been connected
void stopSocketTask()
stop the socket read task and close the associated socket.
virtual IpSocket & getSocketHandler()=0
returns a reference to the socket handler
bool m_stop
Stops the task when set to true.
virtual Fw::Buffer getBuffer()=0
returns a buffer to fill with data
void close()
close the socket communications
static void readTask(void *pointer)
a task designed to read from the socket and output incoming data
virtual ~SocketReadTask()
destructor of the socket read task
void startSocketTask(const Fw::StringBase &name, const bool reconnect=true, const NATIVE_UINT_TYPE priority=Os::Task::TASK_DEFAULT, const NATIVE_UINT_TYPE stack=Os::Task::TASK_DEFAULT, const NATIVE_UINT_TYPE cpuAffinity=Os::Task::TASK_DEFAULT)
start the socket read task to start producing data
bool m_reconnect
Force reconnection.
SocketIpStatus open()
open the socket for communications
virtual void sendBuffer(Fw::Buffer buffer, SocketIpStatus status)=0
sends a buffer to be filled with data
SocketReadTask()
constructs the socket read task
Os::Task::TaskStatus joinSocketTask(void **value_ptr)
joins to the stopping read task to wait for it to close
static void logMsg(const char *fmt, POINTER_CAST a0=0, POINTER_CAST a1=0, POINTER_CAST a2=0, POINTER_CAST a3=0, POINTER_CAST a4=0, POINTER_CAST a5=0, POINTER_CAST a6=0, POINTER_CAST a7=0, POINTER_CAST a8=0, POINTER_CAST a9=0)
static TaskStatus delay(NATIVE_UINT_TYPE msecs)
delay the task
TaskStatus join(void **value_ptr)
Wait for task to finish.
@ TASK_OK
message sent/received okay
bool isStarted()
check to see if task is started
TaskStatus start(const Fw::StringBase &name, taskRoutine routine, void *arg, NATIVE_UINT_TYPE priority=TASK_DEFAULT, NATIVE_UINT_TYPE stackSize=TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity=TASK_DEFAULT, NATIVE_UINT_TYPE identifier=TASK_DEFAULT)
start the task
SocketIpStatus
Status enumeration for socket return values.
@ SOCK_SUCCESS
Socket operation successful.
@ SOCK_INTERRUPTED_TRY_AGAIN
Interrupted status for retries.