WPILibC++ 2023.4.3-108-ge5452e3
Boolean Functions

Functions

NT_Bool NT_SetBoolean (NT_Handle pubentry, int64_t time, NT_Bool value)
 Publish a new value. More...
 
NT_Bool NT_SetDefaultBoolean (NT_Handle pubentry, NT_Bool defaultValue)
 Publish a default value. More...
 
NT_Bool NT_GetBoolean (NT_Handle subentry, NT_Bool defaultValue)
 Get the last published value. More...
 
void NT_GetAtomicBoolean (NT_Handle subentry, NT_Bool defaultValue, struct NT_TimestampedBoolean *value)
 Get the last published value along with its timestamp. More...
 
void NT_DisposeTimestampedBoolean (struct NT_TimestampedBoolean *value)
 Disposes a timestamped value (as returned by NT_GetAtomicBoolean). More...
 
struct NT_TimestampedBooleanNT_ReadQueueBoolean (NT_Handle subentry, size_t *len)
 Get an array of all value changes since the last call to ReadQueue. More...
 
void NT_FreeQueueBoolean (struct NT_TimestampedBoolean *arr, size_t len)
 Frees a timestamped array of values (as returned by NT_ReadQueueBoolean). More...
 
NT_BoolNT_ReadQueueValuesBoolean (NT_Handle subentry, size_t *len)
 Get an array of all value changes since the last call to ReadQueue. More...
 

Detailed Description

Function Documentation

◆ NT_DisposeTimestampedBoolean()

void NT_DisposeTimestampedBoolean ( struct NT_TimestampedBoolean value)

Disposes a timestamped value (as returned by NT_GetAtomicBoolean).

Parameters
valuetimestamped value

◆ NT_FreeQueueBoolean()

void NT_FreeQueueBoolean ( struct NT_TimestampedBoolean arr,
size_t  len 
)

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

Parameters
arrarray
lenlength of array

◆ NT_GetAtomicBoolean()

void NT_GetAtomicBoolean ( NT_Handle  subentry,
NT_Bool  defaultValue,
struct NT_TimestampedBoolean 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_GetBoolean()

NT_Bool NT_GetBoolean ( NT_Handle  subentry,
NT_Bool  defaultValue 
)

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
Returns
value

◆ NT_ReadQueueBoolean()

struct NT_TimestampedBoolean * NT_ReadQueueBoolean ( 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_ReadQueueValuesBoolean()

NT_Bool * NT_ReadQueueValuesBoolean ( NT_Handle  subentry,
size_t *  len 
)

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

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 values; NULL if no new changes have been published since the previous call.

◆ NT_SetBoolean()

NT_Bool NT_SetBoolean ( NT_Handle  pubentry,
int64_t  time,
NT_Bool  value 
)

Publish a new value.

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

◆ NT_SetDefaultBoolean()

NT_Bool NT_SetDefaultBoolean ( NT_Handle  pubentry,
NT_Bool  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