WPILibC++ 2024.3.2
Raw Functions

Functions

bool nt::SetRaw (NT_Handle pubentry, std::span< const uint8_t > value, int64_t time=0)
 Publish a new value. More...
 
bool nt::SetDefaultRaw (NT_Handle pubentry, std::span< const uint8_t > defaultValue)
 Publish a default value. More...
 
std::vector< uint8_t > nt::GetRaw (NT_Handle subentry, std::span< const uint8_t > defaultValue)
 Get the last published value. More...
 
TimestampedRaw nt::GetAtomicRaw (NT_Handle subentry, std::span< const uint8_t > defaultValue)
 Get the last published value along with its timestamp. More...
 
std::vector< TimestampedRawnt::ReadQueueRaw (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::vector< std::vector< uint8_t > > nt::ReadQueueValuesRaw (NT_Handle subentry)
 Get an array of all value changes since the last call to ReadQueue. More...
 
std::span< uint8_t > nt::GetRaw (NT_Handle subentry, wpi::SmallVectorImpl< uint8_t > &buf, std::span< const uint8_t > defaultValue)
 
TimestampedRawView nt::GetAtomicRaw (NT_Handle subentry, wpi::SmallVectorImpl< uint8_t > &buf, std::span< const uint8_t > defaultValue)
 

Detailed Description

Function Documentation

◆ GetAtomicRaw() [1/2]

TimestampedRaw nt::GetAtomicRaw ( NT_Handle  subentry,
std::span< const uint8_t >  defaultValue 
)

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

◆ GetAtomicRaw() [2/2]

TimestampedRawView nt::GetAtomicRaw ( NT_Handle  subentry,
wpi::SmallVectorImpl< uint8_t > &  buf,
std::span< const uint8_t >  defaultValue 
)

◆ GetRaw() [1/2]

std::vector< uint8_t > nt::GetRaw ( NT_Handle  subentry,
std::span< const uint8_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

◆ GetRaw() [2/2]

std::span< uint8_t > nt::GetRaw ( NT_Handle  subentry,
wpi::SmallVectorImpl< uint8_t > &  buf,
std::span< const uint8_t >  defaultValue 
)

◆ ReadQueueRaw()

std::vector< TimestampedRaw > nt::ReadQueueRaw ( NT_Handle  subentry)

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
Returns
Array of timestamped values; empty array if no new changes have been published since the previous call.

◆ ReadQueueValuesRaw()

std::vector< std::vector< uint8_t > > nt::ReadQueueValuesRaw ( NT_Handle  subentry)

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
Returns
Array of values; empty array if no new changes have been published since the previous call.

◆ SetDefaultRaw()

bool nt::SetDefaultRaw ( NT_Handle  pubentry,
std::span< const uint8_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

◆ SetRaw()

bool nt::SetRaw ( NT_Handle  pubentry,
std::span< const uint8_t >  value,
int64_t  time = 0 
)

Publish a new value.

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