Crate ntcore_sys

Crate ntcore_sys 

Source

Structs§

NT_ConnectionInfo
NetworkTables Connection Information
NT_EntryFlags
NetworkTables entry flags.
NT_Event
NetworkTables event
NT_EventFlags
Event notification flags.
NT_LogLevel
NetworkTables logging levels.
NT_LogMessage
NetworkTables log message.
NT_NetworkMode
Client/server modes
NT_PubSubOptions
NetworkTables publish/subscribe options.
NT_TimeSyncEventData
NetworkTables time sync event data.
NT_TimestampedBoolean
Timestamped Boolean.
NT_TimestampedBooleanArray
Timestamped Boolean Array.
NT_TimestampedDouble
Timestamped Double.
NT_TimestampedDoubleArray
Timestamped Double Array.
NT_TimestampedFloat
Timestamped Float.
NT_TimestampedFloatArray
Timestamped Float Array.
NT_TimestampedInteger
Timestamped Integer.
NT_TimestampedIntegerArray
Timestamped Integer Array.
NT_TimestampedRaw
Timestamped Raw.
NT_TimestampedString
Timestamped String.
NT_TimestampedStringArray
Timestamped String Array.
NT_TopicInfo
NetworkTables Topic Information
NT_Type
NetworkTables data types.
NT_Value
NetworkTables Entry Value. Note this is a typed union.
NT_ValueDataArray
Not included in the original ntcore header file, but required because of rust union limitations.
NT_ValueEventData
NetworkTables value event data.
WPI_String

Functions§

NT_AddListener
Create a listener.
NT_AddListenerMultiple
Create a listener for changes to topics with names that start with any of the given prefixes. This creates a corresponding internal subscriber with the lifetime of the listener.
NT_AddListenerSingle
Create a listener for changes to topics with names that start with the given prefix. This creates a corresponding internal subscriber with the lifetime of the listener.
NT_AddLogger
Add logger callback function. By default, log messages are sent to stderr; this function sends log messages to the provided callback function instead. The callback function will only be called for log messages with level greater than or equal to min_level and less than or equal to max_level; messages outside this range will be silently ignored.
NT_AddPolledListener
Creates a polled listener. The caller is responsible for calling NT_ReadListenerQueue() to poll.
NT_AddPolledListenerMultiple
Creates a polled topic listener. This creates a corresponding internal subscriber with the lifetime of the listener. The caller is responsible for calling NT_ReadListenerQueue() to poll.
NT_AddPolledListenerSingle
Creates a polled topic listener. This creates a corresponding internal subscriber with the lifetime of the listener. The caller is responsible for calling NT_ReadListenerQueue() to poll.
NT_AddPolledLogger
Set the log level for a listener poller. Events will only be generated for log messages with level greater than or equal to min_level and less than or equal to max_level; messages outside this range will be silently ignored.
NT_AddSchema
Registers a data schema. Data schemas provide information for how a certain data type string can be decoded. The type string of a data schema indicates the type of the schema itself (e.g. “protobuf” for protobuf schemas, “struct” for struct schemas, etc). In NetworkTables, schemas are published just like normal topics, with the name being generated from the provided name: “/.schema/”. Duplicate calls to this function with the same name are silently ignored.
NT_AllocateBooleanArray
Allocates an array of booleans. Note that the size is the number of elements, and not the specific number of bytes to allocate. That is calculated internally.
NT_AllocateCharArray
Allocates an array of chars. Note that the size is the number of elements, and not the specific number of bytes to allocate. That is calculated internally.
NT_AllocateDoubleArray
Allocates an array of doubles. Note that the size is the number of elements, and not the specific number of bytes to allocate. That is calculated internally.
NT_AllocateFloatArray
Allocates an array of floats. Note that the size is the number of elements, and not the specific number of bytes to allocate. That is calculated internally.
NT_AllocateIntegerArray
Allocates an array of integers. Note that the size is the number of elements, and not the specific number of bytes to allocate. That is calculated internally.
NT_CreateInstance
Create an instance.
NT_CreateListenerPoller
Creates a listener poller.
NT_DeleteTopicProperty
Deletes a property. Has no effect if the property does not exist.
NT_DestroyInstance
Destroy an instance. The default instance cannot be destroyed.
NT_DestroyListenerPoller
Destroys a listener poller. This will abort any blocked polling call and prevent additional events from being generated for this poller.
NT_Disconnect
Disconnects the client if it’s running and connected. This will automatically start reconnection attempts to the current server list.
NT_DisposeConnectionInfoArray
Disposes a connection info array.
NT_DisposeEvent
Disposes a single event.
NT_DisposeEventArray
Disposes an event array.
NT_DisposeTimestampedBoolean
Disposes a timestamped value (as returned by NT_GetAtomicBoolean).
NT_DisposeTimestampedBooleanArray
Disposes a timestamped value (as returned by NT_GetAtomicBooleanArray).
NT_DisposeTimestampedDouble
Disposes a timestamped value (as returned by NT_GetAtomicDouble).
NT_DisposeTimestampedDoubleArray
Disposes a timestamped value (as returned by NT_GetAtomicDoubleArray).
NT_DisposeTimestampedFloat
Disposes a timestamped value (as returned by NT_GetAtomicFloat).
NT_DisposeTimestampedFloatArray
Disposes a timestamped value (as returned by NT_GetAtomicFloatArray).
NT_DisposeTimestampedInteger
Disposes a timestamped value (as returned by NT_GetAtomicInteger).
NT_DisposeTimestampedIntegerArray
Disposes a timestamped value (as returned by NT_GetAtomicIntegerArray).
NT_DisposeTimestampedRaw
Disposes a timestamped value (as returned by NT_GetAtomicRaw).
NT_DisposeTimestampedString
Disposes a timestamped value (as returned by NT_GetAtomicString).
NT_DisposeTimestampedStringArray
Disposes a timestamped value (as returned by NT_GetAtomicStringArray).
NT_DisposeTopicInfo
Disposes a single topic info (as returned by NT_GetTopicInfo).
NT_DisposeTopicInfoArray
Disposes a topic info array.
NT_DisposeValue
Frees value memory.
NT_DisposeValueArray
Frees an array of NT_Values.
NT_Flush
Flush to network.
NT_FlushLocal
Flush local updates.
NT_FreeBooleanArray
Frees an array of booleans.
NT_FreeCharArray
Frees an array of chars.
NT_FreeDoubleArray
Frees an array of doubles.
NT_FreeFloatArray
Frees an array of floats.
NT_FreeIntegerArray
Frees an array of integers.
NT_FreeQueueBoolean
Frees a timestamped array of values (as returned by NT_ReadQueueBoolean).
NT_FreeQueueBooleanArray
Frees a timestamped array of values (as returned by NT_ReadQueueBooleanArray).
NT_FreeQueueDouble
Frees a timestamped array of values (as returned by NT_ReadQueueDouble).
NT_FreeQueueDoubleArray
Frees a timestamped array of values (as returned by NT_ReadQueueDoubleArray).
NT_FreeQueueFloat
Frees a timestamped array of values (as returned by NT_ReadQueueFloat).
NT_FreeQueueFloatArray
Frees a timestamped array of values (as returned by NT_ReadQueueFloatArray).
NT_FreeQueueInteger
Frees a timestamped array of values (as returned by NT_ReadQueueInteger).
NT_FreeQueueIntegerArray
Frees a timestamped array of values (as returned by NT_ReadQueueIntegerArray).
NT_FreeQueueRaw
Frees a timestamped array of values (as returned by NT_ReadQueueRaw).
NT_FreeQueueString
Frees a timestamped array of values (as returned by NT_ReadQueueString).
NT_FreeQueueStringArray
Frees a timestamped array of values (as returned by NT_ReadQueueStringArray).
NT_GetAtomicBoolean
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicBooleanArray
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicDouble
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicDoubleArray
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicFloat
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicFloatArray
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicInteger
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicIntegerArray
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicRaw
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicString
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetAtomicStringArray
Get the last published value along with its timestamp. If no value has been published, returns the passed defaultValue and a timestamp of 0.
NT_GetBoolean
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetBooleanArray
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetConnections
Get information on the currently established network connections. If operating as a client, this will return either zero or one values.
NT_GetDefaultInstance
Get default instance. This is the instance used by non-handle-taking functions.
NT_GetDouble
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetDoubleArray
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetEntry
Get Entry Handle.
NT_GetEntryEx
Creates a new entry (subscriber and weak publisher) to a topic.
NT_GetEntryFlags
Get Entry Flags.
NT_GetEntryLastChange
Gets the last time the entry was changed. Returns 0 if the handle is invalid.
NT_GetEntryName
Gets the name of the specified entry. Returns an empty string if the handle is invalid.
NT_GetEntryType
Gets the type for the specified key, or unassigned if non-existent.
NT_GetEntryValue
Get Entry Value.
NT_GetEntryValueType
Get Entry Value.
NT_GetFloat
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetFloatArray
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetInstanceFromHandle
Get instance handle from another handle.
NT_GetInteger
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetIntegerArray
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetRaw
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetServerTimeOffset
Get the time offset between server time and local time. Add this value to local time to get the estimated equivalent server time. In server mode, this always returns a valid value of 0. In client mode, this returns the time offset only if the client and server are connected and have exchanged synchronization messages. Note the time offset may change over time as it is periodically updated; to receive updates as events, add a listener to the “time sync” event.
NT_GetString
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetStringArray
Get the last published value. If no value has been published, returns the passed defaultValue.
NT_GetTopic
Gets Topic Handle.
NT_GetTopicCached
Gets the cached property of a topic.
NT_GetTopicExists
Determine if topic exists (e.g. has at least one publisher).
NT_GetTopicFromHandle
Gets the topic handle from an entry/subscriber/publisher handle.
NT_GetTopicInfo
Gets Topic Information.
NT_GetTopicInfos
Get Topics.
NT_GetTopicInfosStr
Get Topics.
NT_GetTopicName
Gets the name of the specified topic.
NT_GetTopicPersistent
Gets the persistent property of a topic.
NT_GetTopicProperties
Gets all topic properties as a JSON string. Each key in the object is the property name, and the corresponding value is the property value.
NT_GetTopicProperty
Gets the current value of a property (as a JSON string).
NT_GetTopicRetained
Gets the retained property of a topic.
NT_GetTopicType
Gets the type for the specified topic, or unassigned if non existent.
NT_GetTopicTypeString
Gets the type string for the specified topic. This may have more information than the numeric type (especially for raw values).
NT_GetTopics
Get Published Topic Handles.
NT_GetTopicsStr
Get Published Topic Handles.
NT_GetValueBoolean
Returns the boolean from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
NT_GetValueBooleanArray
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.
NT_GetValueDouble
Returns the double from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
NT_GetValueDoubleArray
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.
NT_GetValueFloat
Returns the float from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
NT_GetValueFloatArray
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.
NT_GetValueInteger
Returns the int from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
NT_GetValueIntegerArray
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.
NT_GetValueRaw
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.
NT_GetValueString
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.
NT_GetValueStringArray
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.
NT_GetValueType
Returns the type of an NT_Value struct. Note that one of the type options is “unassigned”.
NT_HasSchema
Returns whether there is a data schema already registered with the given name. This does NOT perform a check as to whether the schema has already been published by another node on the network.
NT_InitValue
Initializes an NT_Value. Sets type to NT_UNASSIGNED and clears the rest of the struct.
NT_IsConnected
Return whether or not the instance is connected to another node.
NT_Now
Returns monotonic current time in 1 us increments. This is the same time base used for entry and connection timestamps. This function by default simply wraps WPI_Now(), but if NT_SetNow() is called, this function instead returns the value passed to NT_SetNow(); this can be used to reduce overhead.
NT_Publish
Creates a new publisher to a topic.
NT_PublishEx
Creates a new publisher to a topic.
NT_ReadListenerQueue
Read notifications.
NT_ReadQueueBoolean
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueBooleanArray
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueDouble
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueDoubleArray
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueFloat
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueFloatArray
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueInteger
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueIntegerArray
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueRaw
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueString
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueStringArray
Get an array of all value changes since the last call to ReadQueue. Also provides a timestamp for each value.
NT_ReadQueueValue
Read Entry Queue.
NT_ReadQueueValueType
Read Entry Queue.
NT_ReadQueueValuesBoolean
Get an array of all value changes since the last call to ReadQueue.
NT_ReadQueueValuesDouble
Get an array of all value changes since the last call to ReadQueue.
NT_ReadQueueValuesFloat
Get an array of all value changes since the last call to ReadQueue.
NT_ReadQueueValuesInteger
Get an array of all value changes since the last call to ReadQueue.
NT_Release
Stops entry/subscriber/publisher.
NT_ReleaseEntry
Stops entry subscriber/publisher.
NT_RemoveListener
Removes a listener.
NT_SetBoolean
Publish a new value.
NT_SetBooleanArray
Publish a new value.
NT_SetDefaultBoolean
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultBooleanArray
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultDouble
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultDoubleArray
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultEntryValue
Set Default Entry Value.
NT_SetDefaultFloat
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultFloatArray
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultInteger
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultIntegerArray
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultRaw
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultString
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDefaultStringArray
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
NT_SetDouble
Publish a new value.
NT_SetDoubleArray
Publish a new value.
NT_SetEntryFlags
Set Entry Flags.
NT_SetEntryValue
Set Entry Value.
NT_SetFloat
Publish a new value.
NT_SetFloatArray
Publish a new value.
NT_SetInteger
Publish a new value.
NT_SetIntegerArray
Publish a new value.
NT_SetNow
Sets the current timestamp used for timestamping values that do not provide a timestamp (e.g. a value of 0 is passed). For consistency, it also results in NT_Now() returning the set value. This should generally be used only if the overhead of calling WPI_Now() is a concern. If used, it should be called periodically with the value of WPI_Now().
NT_SetRaw
Publish a new value.
NT_SetServer
Sets server address and port for client (without restarting client).
NT_SetServerMulti
Sets server addresses for client (without restarting client). The client will attempt to connect to each server in round-robin fashion.
NT_SetServerTeam
Sets server addresses and port for client (without restarting client). Connects using commonly known robot addresses for the specified team.
NT_SetString
Publish a new value.
NT_SetStringArray
Publish a new value.
NT_SetTopicCached
Sets the cached property of a topic. If true, the server and clients will store the latest value, allowing the value to be read (and not just accessed through event queues and listeners).
NT_SetTopicPersistent
Sets the persistent property of a topic. If true, the stored value is persistent through server restarts.
NT_SetTopicProperties
Updates multiple topic properties. Each key in the passed-in JSON object is the name of the property to add/update, and the corresponding value is the property value to set for that property. Null values result in deletion of the corresponding property.
NT_SetTopicProperty
Sets a property value.
NT_SetTopicRetained
Sets the retained property of a topic. If true, the server retains the topic even when there are no publishers.
NT_StartClient3
Starts a NT3 client. Use NT_SetServer or NT_SetServerTeam to set the server name and port.
NT_StartClient4
Starts a NT4 client. Use NT_SetServer or NT_SetServerTeam to set the server name and port.
NT_StartConnectionDataLog
Starts logging connection changes to a DataLog.
NT_StartDSClient
Starts requesting server address from Driver Station. This connects to the Driver Station running on localhost to obtain the server IP address.
NT_StartEntryDataLog
Starts logging entry changes to a DataLog.
NT_StartLocal
Starts local-only operation. Prevents calls to NT_StartServer or NT_StartClient from taking effect. Has no effect if NT_StartServer or NT_StartClient has already been called.
NT_StartServer
Starts a server using the specified filename, listening address, and port.
NT_StopClient
Stops the client if it is running.
NT_StopConnectionDataLog
Stops logging connection changes to a DataLog.
NT_StopDSClient
Stops requesting server address from Driver Station.
NT_StopEntryDataLog
Stops logging entry changes to a DataLog.
NT_StopLocal
Stops local-only operation. NT_StartServer or NT_StartClient can be called after this call to start a server or client.
NT_StopServer
Stops the server if it is running.
NT_Subscribe
Creates a new subscriber to value changes on a topic.
NT_SubscribeMultiple
Subscribes to multiple topics based on one or more topic name prefixes. Can be used in combination with a Value Listener or ReadQueueValue() to get value changes across all matching topics.
NT_Unpublish
Stops publisher.
NT_Unsubscribe
Stops subscriber.
NT_UnsubscribeMultiple
Unsubscribes a multi-subscriber.
NT_WaitForListenerQueue
Wait for the listener queue to be empty. This is primarily useful for deterministic testing. This blocks until either the listener queue is empty (e.g. there are no more events that need to be passed along to callbacks or poll queues) or the timeout expires.

Type Aliases§

NT_Bool
NT_ConnectionDataLogger
NT_DataLogger
NT_Entry
NT_Handle
NT_Inst
NT_Listener
NT_ListenerCallback
Event listener callback function.
NT_ListenerPoller
NT_MultiSubscriber
NT_Publisher
NT_Subscriber
NT_Topic
WPI_DataLog

Unions§

NT_EventData
NT_ValueData