Crate ntcore_sys

Source

Structs§

Functions§

  • Create a listener.
  • 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.
  • 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.
  • 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.
  • Creates a polled listener. The caller is responsible for calling NT_ReadListenerQueue() to poll.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • Create an instance.
  • Creates a listener poller.
  • Deletes a property. Has no effect if the property does not exist.
  • Destroy an instance. The default instance cannot be destroyed.
  • Destroys a listener poller. This will abort any blocked polling call and prevent additional events from being generated for this poller.
  • Disconnects the client if it’s running and connected. This will automatically start reconnection attempts to the current server list.
  • Disposes a connection info array.
  • Disposes a single event.
  • Disposes an event array.
  • Disposes a single topic info (as returned by NT_GetTopicInfo).
  • Disposes a topic info array.
  • Frees value memory.
  • Frees an array of NT_Values.
  • Flush to network.
  • Flush local updates.
  • Frees an array of booleans.
  • Frees an array of chars.
  • Frees an array of doubles.
  • Frees an array of floats.
  • Frees an array of integers.
  • Get information on the currently established network connections. If operating as a client, this will return either zero or one values.
  • Get default instance. This is the instance used by non-handle-taking functions.
  • Get Entry Handle.
  • Creates a new entry (subscriber and weak publisher) to a topic.
  • Get Entry Flags.
  • Gets the last time the entry was changed. Returns 0 if the handle is invalid.
  • Gets the name of the specified entry. Returns an empty string if the handle is invalid.
  • Gets the type for the specified key, or unassigned if non-existent.
  • Get Entry Value.
  • Get Entry Value.
  • Get instance handle from another handle.
  • 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.
  • Gets Topic Handle.
  • Gets the cached property of a topic.
  • Determine if topic exists (e.g. has at least one publisher).
  • Gets the topic handle from an entry/subscriber/publisher handle.
  • Gets Topic Information.
  • Get Topics.
  • Get Topics.
  • Gets the name of the specified topic.
  • Gets the persistent property of a topic.
  • 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.
  • Gets the current value of a property (as a JSON string).
  • Gets the retained property of a topic.
  • Gets the type for the specified topic, or unassigned if non existent.
  • Gets the type string for the specified topic. This may have more information than the numeric type (especially for raw values).
  • Get Published Topic Handles.
  • Get Published Topic Handles.
  • Returns the boolean from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
  • 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.
  • Returns the double from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
  • 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.
  • Returns the float from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
  • 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.
  • Returns the int from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns 0.
  • 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.
  • 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.
  • 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.
  • 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.
  • Returns the type of an NT_Value struct. Note that one of the type options is “unassigned”.
  • 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.
  • Initializes an NT_Value. Sets type to NT_UNASSIGNED and clears the rest of the struct.
  • Return whether or not the instance is connected to another node.
  • 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.
  • Creates a new publisher to a topic.
  • Creates a new publisher to a topic.
  • Read notifications.
  • Read Entry Queue.
  • Read Entry Queue.
  • Stops entry/subscriber/publisher.
  • Stops entry subscriber/publisher.
  • Removes a listener.
  • Set Default Entry Value.
  • Set Entry Flags.
  • Set Entry Value.
  • 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().
  • Sets server address and port for client (without restarting client).
  • Sets server addresses for client (without restarting client). The client will attempt to connect to each server in round-robin fashion.
  • Sets server addresses and port for client (without restarting client). Connects using commonly known robot addresses for the specified team.
  • 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).
  • Sets the persistent property of a topic. If true, the stored value is persistent through server restarts.
  • 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.
  • Sets a property value.
  • Sets the retained property of a topic. If true, the server retains the topic even when there are no publishers.
  • Starts a NT3 client. Use NT_SetServer or NT_SetServerTeam to set the server name and port.
  • Starts a NT4 client. Use NT_SetServer or NT_SetServerTeam to set the server name and port.
  • Starts logging connection changes to a DataLog.
  • Starts requesting server address from Driver Station. This connects to the Driver Station running on localhost to obtain the server IP address.
  • Starts logging entry changes to a DataLog.
  • 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.
  • Starts a server using the specified filename, listening address, and port.
  • Stops the client if it is running.
  • Stops logging connection changes to a DataLog.
  • Stops requesting server address from Driver Station.
  • Stops logging entry changes to a DataLog.
  • Stops local-only operation. NT_StartServer or NT_StartClient can be called after this call to start a server or client.
  • Stops the server if it is running.
  • Creates a new subscriber to value changes on a topic.
  • 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.
  • Stops publisher.
  • Stops subscriber.
  • Unsubscribes a multi-subscriber.
  • 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§

Unions§