WPILibC++ 2024.3.2
Integer Functions

Functions

NT_Bool NT_SetInteger (NT_Handle pubentry, int64_t time, int64_t value)
 Publish a new value. More...
 
NT_Bool NT_SetDefaultInteger (NT_Handle pubentry, int64_t defaultValue)
 Publish a default value. More...
 
int64_t NT_GetInteger (NT_Handle subentry, int64_t defaultValue)
 Get the last published value. More...
 
void NT_GetAtomicInteger (NT_Handle subentry, int64_t defaultValue, struct NT_TimestampedInteger *value)
 Get the last published value along with its timestamp. More...
 
void NT_DisposeTimestampedInteger (struct NT_TimestampedInteger *value)
 Disposes a timestamped value (as returned by NT_GetAtomicInteger). More...
 
struct NT_TimestampedIntegerNT_ReadQueueInteger (NT_Handle subentry, size_t *len)
 Get an array of all value changes since the last call to ReadQueue. More...
 
void NT_FreeQueueInteger (struct NT_TimestampedInteger *arr, size_t len)
 Frees a timestamped array of values (as returned by NT_ReadQueueInteger). More...
 
int64_t * NT_ReadQueueValuesInteger (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_DisposeTimestampedInteger()

void NT_DisposeTimestampedInteger ( struct NT_TimestampedInteger value)

Disposes a timestamped value (as returned by NT_GetAtomicInteger).

Parameters
valuetimestamped value

◆ NT_FreeQueueInteger()

void NT_FreeQueueInteger ( struct NT_TimestampedInteger arr,
size_t  len 
)

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

Parameters
arrarray
lenlength of array

◆ NT_GetAtomicInteger()

void NT_GetAtomicInteger ( NT_Handle  subentry,
int64_t  defaultValue,
struct NT_TimestampedInteger 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_GetInteger()

int64_t NT_GetInteger ( NT_Handle  subentry,
int64_t  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_ReadQueueInteger()

struct NT_TimestampedInteger * NT_ReadQueueInteger ( 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_ReadQueueValuesInteger()

int64_t * NT_ReadQueueValuesInteger ( 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_SetDefaultInteger()

NT_Bool NT_SetDefaultInteger ( NT_Handle  pubentry,
int64_t  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_SetInteger()

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

Publish a new value.

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