WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
String Functions

Functions

NT_Bool NT_SetString (NT_Handle pubentry, int64_t time, const struct WPI_String *value)
 Publish a new value.
 
NT_Bool NT_SetDefaultString (NT_Handle pubentry, const struct WPI_String *defaultValue)
 Publish a default value.
 
void NT_GetString (NT_Handle subentry, const struct WPI_String *defaultValue, struct WPI_String *value)
 Get the last published value.
 
void NT_GetAtomicString (NT_Handle subentry, const struct WPI_String *defaultValue, struct NT_TimestampedString *value)
 Get the last published value along with its timestamp.
 
void NT_DisposeTimestampedString (struct NT_TimestampedString *value)
 Disposes a timestamped value (as returned by NT_GetAtomicString).
 
struct NT_TimestampedStringNT_ReadQueueString (NT_Handle subentry, size_t *len)
 Get an array of all value changes since the last call to ReadQueue.
 
void NT_FreeQueueString (struct NT_TimestampedString *arr, size_t len)
 Frees a timestamped array of values (as returned by NT_ReadQueueString).
 

Detailed Description

Function Documentation

◆ NT_DisposeTimestampedString()

void NT_DisposeTimestampedString ( struct NT_TimestampedString * value)

Disposes a timestamped value (as returned by NT_GetAtomicString).

Parameters
valuetimestamped value

◆ NT_FreeQueueString()

void NT_FreeQueueString ( struct NT_TimestampedString * arr,
size_t len )

Frees a timestamped array of values (as returned by NT_ReadQueueString).

Parameters
arrarray
lenlength of array

◆ NT_GetAtomicString()

void NT_GetAtomicString ( NT_Handle subentry,
const struct WPI_String * defaultValue,
struct NT_TimestampedString * value )

Get the last published value along with its timestamp.

If no value has been published, returns the passed defaultValue and a timestamp of 0.

Parameters
subentrysubscriber or entry handle
defaultValuedefault value to return if no value has been published
valuetimestamped value (output)

◆ NT_GetString()

void NT_GetString ( NT_Handle subentry,
const struct WPI_String * defaultValue,
struct WPI_String * value )

Get the last published value.

If no value has been published, returns the passed defaultValue.

Parameters
subentrysubscriber or entry handle
defaultValuedefault value to return if no value has been published
valuereturned value (output)

◆ NT_ReadQueueString()

struct NT_TimestampedString * NT_ReadQueueString ( NT_Handle subentry,
size_t * len )

Get an array of all value changes since the last call to ReadQueue.

Also provides a timestamp for each value.

Note
The "poll storage" subscribe option can be used to set the queue depth.
Parameters
subentrysubscriber or entry handle
lenlength of returned array (output)
Returns
Array of timestamped values; NULL if no new changes have been published since the previous call.

◆ NT_SetDefaultString()

NT_Bool NT_SetDefaultString ( NT_Handle pubentry,
const struct WPI_String * defaultValue )

Publish a default value.

On reconnect, a default value will never be used in preference to a published value.

Parameters
pubentrypublisher or entry handle
defaultValuedefault value

◆ NT_SetString()

NT_Bool NT_SetString ( NT_Handle pubentry,
int64_t time,
const struct WPI_String * value )

Publish a new value.

Parameters
pubentrypublisher or entry handle
timetimestamp; 0 indicates current NT time should be used
valuevalue to publish