WPILibC++ 2025.0.0-alpha-1-24-g6478ba6

Functions

enum NT_Type NT_GetValueType (const struct NT_Value *value)
 Returns the type of an NT_Value struct. More...
 
NT_Bool NT_GetValueBoolean (const struct NT_Value *value, uint64_t *last_change, NT_Bool *v_boolean)
 Returns the boolean from the NT_Value. More...
 
NT_Bool NT_GetValueInteger (const struct NT_Value *value, uint64_t *last_change, int64_t *v_int)
 Returns the int from the NT_Value. More...
 
NT_Bool NT_GetValueFloat (const struct NT_Value *value, uint64_t *last_change, float *v_float)
 Returns the float from the NT_Value. More...
 
NT_Bool NT_GetValueDouble (const struct NT_Value *value, uint64_t *last_change, double *v_double)
 Returns the double from the NT_Value. More...
 
char * NT_GetValueString (const struct NT_Value *value, uint64_t *last_change, size_t *str_len)
 Returns a copy of the string from the NT_Value. More...
 
uint8_t * NT_GetValueRaw (const struct NT_Value *value, uint64_t *last_change, size_t *raw_len)
 Returns a copy of the raw value from the NT_Value. More...
 
NT_BoolNT_GetValueBooleanArray (const struct NT_Value *value, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the boolean array from the NT_Value. More...
 
int64_t * NT_GetValueIntegerArray (const struct NT_Value *value, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the int array from the NT_Value. More...
 
float * NT_GetValueFloatArray (const struct NT_Value *value, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the float array from the NT_Value. More...
 
double * NT_GetValueDoubleArray (const struct NT_Value *value, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the double array from the NT_Value. More...
 
struct WPI_StringNT_GetValueStringArray (const struct NT_Value *value, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the struct WPI_String array from the NT_Value. More...
 

Detailed Description

Function Documentation

◆ NT_GetValueBoolean()

NT_Bool NT_GetValueBoolean ( const struct NT_Value value,
uint64_t *  last_change,
NT_Bool v_boolean 
)

Returns the boolean from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns 0.

Parameters
valueNT_Value struct to get the boolean from
last_changereturns time in ms since the last change in the value
v_booleanreturns the boolean assigned to the name
Returns
1 if successful, or 0 if value is null or not a boolean

◆ NT_GetValueBooleanArray()

NT_Bool * NT_GetValueBooleanArray ( const struct NT_Value value,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the boolean array from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns null.

Parameters
valueNT_Value struct to get the boolean array from
last_changereturns time in ms since the last change in the value
arr_sizereturns the number of elements in the array
Returns
pointer to the boolean array, or null if error

It is the caller's responsibility to free the array once its no longer needed. The NT_FreeBooleanArray() function is useful for this purpose. The returned array is a copy of the array in the value, and must be freed separately.

◆ NT_GetValueDouble()

NT_Bool NT_GetValueDouble ( const struct NT_Value value,
uint64_t *  last_change,
double *  v_double 
)

Returns the double from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns 0.

Parameters
valueNT_Value struct to get the double from
last_changereturns time in ms since the last change in the value
v_doublereturns the double assigned to the name
Returns
1 if successful, or 0 if value is null or not a double

◆ NT_GetValueDoubleArray()

double * NT_GetValueDoubleArray ( const struct NT_Value value,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the double array from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns null.

Parameters
valueNT_Value struct to get the double array from
last_changereturns time in ms since the last change in the value
arr_sizereturns the number of elements in the array
Returns
pointer to the double array, or null if error

It is the caller's responsibility to free the array once its no longer needed. The NT_FreeDoubleArray() function is useful for this purpose. The returned array is a copy of the array in the value, and must be freed separately.

◆ NT_GetValueFloat()

NT_Bool NT_GetValueFloat ( const struct NT_Value value,
uint64_t *  last_change,
float *  v_float 
)

Returns the float from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns 0.

Parameters
valueNT_Value struct to get the float from
last_changereturns time in ms since the last change in the value
v_floatreturns the float assigned to the name
Returns
1 if successful, or 0 if value is null or not a float

◆ NT_GetValueFloatArray()

float * NT_GetValueFloatArray ( const struct NT_Value value,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the float array from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns null.

Parameters
valueNT_Value struct to get the float array from
last_changereturns time in ms since the last change in the value
arr_sizereturns the number of elements in the array
Returns
pointer to the float array, or null if error

It is the caller's responsibility to free the array once its no longer needed. The NT_FreeFloatArray() function is useful for this purpose. The returned array is a copy of the array in the value, and must be freed separately.

◆ NT_GetValueInteger()

NT_Bool NT_GetValueInteger ( const struct NT_Value value,
uint64_t *  last_change,
int64_t *  v_int 
)

Returns the int from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns 0.

Parameters
valueNT_Value struct to get the int from
last_changereturns time in ms since the last change in the value
v_intreturns the int assigned to the name
Returns
1 if successful, or 0 if value is null or not an int

◆ NT_GetValueIntegerArray()

int64_t * NT_GetValueIntegerArray ( const struct NT_Value value,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the int array from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns null.

Parameters
valueNT_Value struct to get the int array from
last_changereturns time in ms since the last change in the value
arr_sizereturns the number of elements in the array
Returns
pointer to the int array, or null if error

It is the caller's responsibility to free the array once its no longer needed. The NT_FreeIntArray() function is useful for this purpose. The returned array is a copy of the array in the value, and must be freed separately.

◆ NT_GetValueRaw()

uint8_t * NT_GetValueRaw ( const struct NT_Value value,
uint64_t *  last_change,
size_t *  raw_len 
)

Returns a copy of the raw value from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns null.

Parameters
valueNT_Value struct to get the string from
last_changereturns time in ms since the last change in the value
raw_lenreturns the length of the string
Returns
pointer to the raw value (UTF-8), or null if error

It is the caller's responsibility to free the raw value once its no longer needed. The NT_FreeCharArray() function is useful for this purpose. The returned string is a copy of the string in the value, and must be freed separately.

◆ NT_GetValueString()

char * NT_GetValueString ( const struct NT_Value value,
uint64_t *  last_change,
size_t *  str_len 
)

Returns a copy of the string from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns 0.

Parameters
valueNT_Value struct to get the string from
last_changereturns time in ms since the last change in the value
str_lenreturns the length of the string
Returns
pointer to the string (UTF-8), or null if error

It is the caller's responsibility to free the string once its no longer needed. The NT_FreeCharArray() function is useful for this purpose. The returned string is a copy of the string in the value, and must be freed separately.

◆ NT_GetValueStringArray()

struct WPI_String * NT_GetValueStringArray ( const struct NT_Value value,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the struct WPI_String array from the NT_Value.

If the NT_Value is null, or is assigned to a different type, returns null.

Parameters
valueNT_Value struct to get the struct WPI_String array from
last_changereturns time in ms since the last change in the value
arr_sizereturns the number of elements in the array
Returns
pointer to the struct WPI_String array, or null if error

It is the caller's responsibility to free the array once its no longer needed. The WPI_FreeStringArray() function is useful for this purpose. The returned array is a copy of the array in the value, and must be freed separately. Note that the individual struct WPI_Strings should not be freed, but the entire array should be freed at once. The WPI_FreeStringArray() function will free all the struct WPI_Strings.

◆ NT_GetValueType()

enum NT_Type NT_GetValueType ( const struct NT_Value value)

Returns the type of an NT_Value struct.

Note that one of the type options is "unassigned".

Parameters
valueThe NT_Value struct to get the type from.
Returns
The type of the value, or unassigned if null.