Voyant API 0.2.1
Loading...
Searching...
No Matches
Classes | Functions
points_client.hpp File Reference
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

Go to the source code of this file.

Classes

struct  PointsClientC
 

Functions

PointsClientC new_unicast_points_client_c (const char *addr, bool filter_points)
 
PointsClientC new_multicast_points_client_c (const char *bind_addr, const char *group_addr, const char *interface_addr, bool filter_points)
 
int32_t move_latest_into_c (const PointsClientC *client, uint8_t *dest, uintptr_t len)
 
void free_points_client (PointsClientC client)
 

Function Documentation

◆ free_points_client()

void free_points_client ( PointsClientC  client)

Frees memory associated with a PointsClientC instance

Parameters
clientPointsClientC instance to free
Warning
client must be a valid PointsClientC instance
After calling this function, the client instance should not be used

◆ move_latest_into_c()

int32_t move_latest_into_c ( const PointsClientC client,
uint8_t *  dest,
uintptr_t  len 
)

Copies the latest frame data from the client into a provided buffer

Parameters
clientReference to PointsClientC instance
destPointer to destination buffer
lenLength of destination buffer in bytes
Returns
Positive number: Number of bytes copied
0: No new data available
-1: Client is invalid (null pointer)
Warning
client must be a valid PointsClientC instance
dest must point to a buffer of at least len bytes

◆ new_multicast_points_client_c()

PointsClientC new_multicast_points_client_c ( const char *  bind_addr,
const char *  group_addr,
const char *  interface_addr,
bool  filter_points 
)

Creates a new multicast PointsClient

Parameters
bind_addrC string containing UDP address to bind to (e.g., "0.0.0.0:4444")
group_addrC string containing multicast group address (e.g., "224.0.0.0")
interface_addrC string containing interface address (e.g., "127.0.0.1")
filter_pointsWhether to filter out invalid points. When set to true, any invalid points will be removed from the frames. When set to false, all points including invalid ones will be included.
Returns
PointsClientC struct containing the client and its runtime
Note
Returns a PointsClientC with null pointers if creation fails
Warning
bind_addr, group_addr, and interface_addr must be valid null-terminated C strings

◆ new_unicast_points_client_c()

PointsClientC new_unicast_points_client_c ( const char *  addr,
bool  filter_points 
)

Creates a new unicast PointsClient with the specified UDP address

Parameters
addrC string containing UDP address to listen on
filter_pointsWhether to filter out invalid points. When set to true, any invalid points will be removed from the frames. When set to false, all points including invalid ones will be included.
Returns
PointsClientC struct containing the client and its runtime
Note
Returns a PointsClientC with null pointers if creation fails
Warning
addr must be a valid null-terminated C string