Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
socket.h File Reference

Local non-blocking UDP channel used by USHER's development pipeline. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int socket_init (int is_server)
 Create the loopback UDP endpoint and, for a server, claim USHER ownership.
void socket_deinit (void)
 Close the owned UDP endpoint; repeated calls are harmless.
int socket_get_fd (void)
 Return the active UDP descriptor for polling.
int socket_recv (char *buffer, int len)
 Receive one datagram without blocking.
void socket_send (char *buffer, int len)
 Send one loopback datagram without blocking.

Detailed Description

Local non-blocking UDP channel used by USHER's development pipeline.

This is intentionally loopback-only infrastructure for local SODA and simulator integration, not a network-facing control protocol.

Definition in file socket.h.

Function Documentation

◆ socket_deinit()

void socket_deinit ( void )

Close the owned UDP endpoint; repeated calls are harmless.

Definition at line 96 of file socket.c.

◆ socket_get_fd()

int socket_get_fd ( void )

Return the active UDP descriptor for polling.

Returns
Borrowed descriptor, or a negative value before initialization/after teardown.

Definition at line 102 of file socket.c.

◆ socket_init()

int socket_init ( int is_server)

Create the loopback UDP endpoint and, for a server, claim USHER ownership.

Parameters
is_serverNonzero to bind the fixed local port; zero for an unbound sender.
Returns
0 on success, or -1 on failure; EALREADY preserves an active endpoint.

The server bind doubles as the physical-mode single-instance claim. A second USHER must fail rather than share the port because it would also compete for the same UART and camera resources.

Definition at line 44 of file socket.c.

◆ socket_recv()

int socket_recv ( char * buffer,
int len )

Receive one datagram without blocking.

Parameters
bufferDestination bytes.
lenDestination capacity.
Returns
recvfrom() result, including -1/EAGAIN when no datagram is ready.

Definition at line 107 of file socket.c.

◆ socket_send()

void socket_send ( char * buffer,
int len )

Send one loopback datagram without blocking.

Parameters
bufferPayload bytes.
lenPayload length.

Definition at line 126 of file socket.c.