WPILibC++  2018.4.1-20180920141831-1187-gd2a5aaa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages

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_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...
 
char * 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...
 
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 NT_StringNT_GetValueStringArray (const struct NT_Value *value, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the NT_String array from the NT_Value. More...
 
NT_Bool NT_GetEntryBoolean (NT_Entry entry, uint64_t *last_change, NT_Bool *v_boolean)
 Returns the boolean currently assigned to the entry name. More...
 
NT_Bool NT_GetEntryDouble (NT_Entry entry, uint64_t *last_change, double *v_double)
 Returns the double currently assigned to the entry name. More...
 
char * NT_GetEntryString (NT_Entry entry, uint64_t *last_change, size_t *str_len)
 Returns a copy of the string assigned to the entry name. More...
 
char * NT_GetEntryRaw (NT_Entry entry, uint64_t *last_change, size_t *raw_len)
 Returns a copy of the raw value assigned to the entry name. More...
 
NT_BoolNT_GetEntryBooleanArray (NT_Entry entry, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the boolean array assigned to the entry name. More...
 
double * NT_GetEntryDoubleArray (NT_Entry entry, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the double array assigned to the entry name. More...
 
struct NT_StringNT_GetEntryStringArray (NT_Entry entry, uint64_t *last_change, size_t *arr_size)
 Returns a copy of the NT_String array assigned to the entry name. More...
 

Detailed Description

Function Documentation

NT_Bool NT_GetEntryBoolean ( NT_Entry  entry,
uint64_t *  last_change,
NT_Bool v_boolean 
)

Returns the boolean currently assigned to the entry name.

If the entry name is not currently assigned, or is assigned to a different type, returns 0.

Parameters
entryentry handle
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 unassigned or not a boolean
NT_Bool* NT_GetEntryBooleanArray ( NT_Entry  entry,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the boolean array assigned to the entry name.

If the entry name is not currently assigned, or is assigned to a different type, returns null.

Parameters
entryentry handle
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.

NT_Bool NT_GetEntryDouble ( NT_Entry  entry,
uint64_t *  last_change,
double *  v_double 
)

Returns the double currently assigned to the entry name.

If the entry name is not currently assigned, or is assigned to a different type, returns 0.

Parameters
entryentry handle
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 unassigned or not a double
double* NT_GetEntryDoubleArray ( NT_Entry  entry,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the double array assigned to the entry name.

If the entry name is not currently assigned, or is assigned to a different type, returns null.

Parameters
entryentry handle
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.

char* NT_GetEntryRaw ( NT_Entry  entry,
uint64_t *  last_change,
size_t *  raw_len 
)

Returns a copy of the raw value assigned to the entry name.

If the entry name is not currently assigned, or is assigned to a different type, returns null.

Parameters
entryentry handle
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.

char* NT_GetEntryString ( NT_Entry  entry,
uint64_t *  last_change,
size_t *  str_len 
)

Returns a copy of the string assigned to the entry name.

If the entry name is not currently assigned, or is assigned to a different type, returns null.

Parameters
entryentry handle
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.

struct NT_String* NT_GetEntryStringArray ( NT_Entry  entry,
uint64_t *  last_change,
size_t *  arr_size 
)

Returns a copy of the NT_String array assigned to the entry name.

If the entry name is not currently assigned, or is assigned to a different type, returns null.

Parameters
entryentry handle
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 NT_String array, or null if error

It is the caller's responsibility to free the array once its no longer needed. The NT_FreeStringArray() function is useful for this purpose. Note that the individual NT_Strings should not be freed, but the entire array should be freed at once. The NT_FreeStringArray() function will free all the NT_Strings.

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_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_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 boolean assigned to the name
Returns
1 if successful, or 0 if value is null or not a double
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.

char* 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.

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.

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

Returns a copy of the NT_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 NT_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 NT_String array, or null if error

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

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.