WPILibC++ 2024.3.2
|
Functions | |
NT_Topic * | NT_GetTopics (NT_Inst inst, const char *prefix, size_t prefix_len, unsigned int types, size_t *count) |
Get Published Topic Handles. More... | |
NT_Topic * | NT_GetTopicsStr (NT_Inst inst, const char *prefix, size_t prefix_len, const char *const *types, size_t types_len, size_t *count) |
Get Published Topic Handles. More... | |
struct NT_TopicInfo * | NT_GetTopicInfos (NT_Inst inst, const char *prefix, size_t prefix_len, unsigned int types, size_t *count) |
Get Topics. More... | |
struct NT_TopicInfo * | NT_GetTopicInfosStr (NT_Inst inst, const char *prefix, size_t prefix_len, const char *const *types, size_t types_len, size_t *count) |
Get Topics. More... | |
NT_Bool | NT_GetTopicInfo (NT_Topic topic, struct NT_TopicInfo *info) |
Gets Topic Information. More... | |
NT_Topic | NT_GetTopic (NT_Inst inst, const char *name, size_t name_len) |
Gets Topic Handle. More... | |
char * | NT_GetTopicName (NT_Topic topic, size_t *name_len) |
Gets the name of the specified topic. More... | |
enum NT_Type | NT_GetTopicType (NT_Topic topic) |
Gets the type for the specified topic, or unassigned if non existent. More... | |
char * | NT_GetTopicTypeString (NT_Topic topic, size_t *type_len) |
Gets the type string for the specified topic. More... | |
void | NT_SetTopicPersistent (NT_Topic topic, NT_Bool value) |
Sets the persistent property of a topic. More... | |
NT_Bool | NT_GetTopicPersistent (NT_Topic topic) |
Gets the persistent property of a topic. More... | |
void | NT_SetTopicRetained (NT_Topic topic, NT_Bool value) |
Sets the retained property of a topic. More... | |
NT_Bool | NT_GetTopicRetained (NT_Topic topic) |
Gets the retained property of a topic. More... | |
void | NT_SetTopicCached (NT_Topic topic, NT_Bool value) |
Sets the cached property of a topic. More... | |
NT_Bool | NT_GetTopicCached (NT_Topic topic) |
Gets the cached property of a topic. More... | |
NT_Bool | NT_GetTopicExists (NT_Handle handle) |
Determine if topic exists (e.g. More... | |
char * | NT_GetTopicProperty (NT_Topic topic, const char *name, size_t *len) |
Gets the current value of a property (as a JSON string). More... | |
NT_Bool | NT_SetTopicProperty (NT_Topic topic, const char *name, const char *value) |
Sets a property value. More... | |
void | NT_DeleteTopicProperty (NT_Topic topic, const char *name) |
Deletes a property. More... | |
char * | NT_GetTopicProperties (NT_Topic topic, size_t *len) |
Gets all topic properties as a JSON string. More... | |
NT_Bool | NT_SetTopicProperties (NT_Topic topic, const char *properties) |
Updates multiple topic properties. More... | |
NT_Subscriber | NT_Subscribe (NT_Topic topic, enum NT_Type type, const char *typeStr, const struct NT_PubSubOptions *options) |
Creates a new subscriber to value changes on a topic. More... | |
void | NT_Unsubscribe (NT_Subscriber sub) |
Stops subscriber. More... | |
NT_Publisher | NT_Publish (NT_Topic topic, enum NT_Type type, const char *typeStr, const struct NT_PubSubOptions *options) |
Creates a new publisher to a topic. More... | |
NT_Publisher | NT_PublishEx (NT_Topic topic, enum NT_Type type, const char *typeStr, const char *properties, const struct NT_PubSubOptions *options) |
Creates a new publisher to a topic. More... | |
void | NT_Unpublish (NT_Handle pubentry) |
Stops publisher. More... | |
NT_Entry | NT_GetEntryEx (NT_Topic topic, enum NT_Type type, const char *typeStr, const struct NT_PubSubOptions *options) |
Creates a new entry (subscriber and weak publisher) to a topic. More... | |
void | NT_ReleaseEntry (NT_Entry entry) |
Stops entry subscriber/publisher. More... | |
void | NT_Release (NT_Handle pubsubentry) |
Stops entry/subscriber/publisher. More... | |
NT_Topic | NT_GetTopicFromHandle (NT_Handle pubsubentry) |
Gets the topic handle from an entry/subscriber/publisher handle. More... | |
void NT_DeleteTopicProperty | ( | NT_Topic | topic, |
const char * | name | ||
) |
Deletes a property.
Has no effect if the property does not exist.
topic | topic handle |
name | property name |
NT_Entry NT_GetEntryEx | ( | NT_Topic | topic, |
enum NT_Type | type, | ||
const char * | typeStr, | ||
const struct NT_PubSubOptions * | options | ||
) |
Creates a new entry (subscriber and weak publisher) to a topic.
topic | topic handle |
type | type |
typeStr | type string |
options | publish options |
Gets Topic Handle.
Returns topic handle.
inst | instance handle |
name | topic name |
name_len | length of topic name in bytes |
Gets the cached property of a topic.
topic | topic handle |
Determine if topic exists (e.g.
has at least one publisher).
handle | Topic, entry, or subscriber handle. |
Gets the topic handle from an entry/subscriber/publisher handle.
pubsubentry | entry/subscriber/publisher handle |
NT_Bool NT_GetTopicInfo | ( | NT_Topic | topic, |
struct NT_TopicInfo * | info | ||
) |
Gets Topic Information.
Returns information about a topic (name and type).
topic | handle |
info | information (output) |
struct NT_TopicInfo * NT_GetTopicInfos | ( | NT_Inst | inst, |
const char * | prefix, | ||
size_t | prefix_len, | ||
unsigned int | types, | ||
size_t * | count | ||
) |
Get Topics.
Returns an array of topic information (handle, name, type). The results are optionally filtered by string prefix and type to only return a subset of all topics.
inst | instance handle |
prefix | name required prefix; only topics whose name starts with this string are returned |
prefix_len | length of prefix in bytes |
types | bitmask of NT_Type values; 0 is treated specially as a "don't care" |
count | output parameter; set to length of returned array |
struct NT_TopicInfo * NT_GetTopicInfosStr | ( | NT_Inst | inst, |
const char * | prefix, | ||
size_t | prefix_len, | ||
const char *const * | types, | ||
size_t | types_len, | ||
size_t * | count | ||
) |
Get Topics.
Returns an array of topic information (handle, name, type). The results are optionally filtered by string prefix and type to only return a subset of all topics.
inst | instance handle |
prefix | name required prefix; only topics whose name starts with this string are returned |
prefix_len | length of prefix in bytes |
types | array of type strings |
types_len | number of elements in types array |
count | output parameter; set to length of returned array |
char * NT_GetTopicName | ( | NT_Topic | topic, |
size_t * | name_len | ||
) |
Gets the name of the specified topic.
topic | topic handle |
name_len | length of topic name (output) |
Gets the persistent property of a topic.
topic | topic handle |
char * NT_GetTopicProperties | ( | NT_Topic | topic, |
size_t * | len | ||
) |
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.
topic | topic handle |
len | length of returned string (output) |
char * NT_GetTopicProperty | ( | NT_Topic | topic, |
const char * | name, | ||
size_t * | len | ||
) |
Gets the current value of a property (as a JSON string).
topic | topic handle |
name | property name |
len | length of returned string (output) |
Gets the retained property of a topic.
topic | topic handle |
NT_Topic * NT_GetTopics | ( | NT_Inst | inst, |
const char * | prefix, | ||
size_t | prefix_len, | ||
unsigned int | types, | ||
size_t * | count | ||
) |
Get Published Topic Handles.
Returns an array of topic handles. The results are optionally filtered by string prefix and type to only return a subset of all topics.
inst | instance handle |
prefix | name required prefix; only topics whose name starts with this string are returned |
prefix_len | length of prefix in bytes |
types | bitmask of NT_Type values; 0 is treated specially as a "don't care" |
count | output parameter; set to length of returned array |
NT_Topic * NT_GetTopicsStr | ( | NT_Inst | inst, |
const char * | prefix, | ||
size_t | prefix_len, | ||
const char *const * | types, | ||
size_t | types_len, | ||
size_t * | count | ||
) |
Get Published Topic Handles.
Returns an array of topic handles. The results are optionally filtered by string prefix and type to only return a subset of all topics.
inst | instance handle |
prefix | name required prefix; only topics whose name starts with this string are returned |
prefix_len | length of prefix in bytes |
types | array of type strings |
types_len | number of elements in types array |
count | output parameter; set to length of returned array |
Gets the type for the specified topic, or unassigned if non existent.
topic | topic handle |
char * NT_GetTopicTypeString | ( | NT_Topic | topic, |
size_t * | type_len | ||
) |
Gets the type string for the specified topic.
This may have more information than the numeric type (especially for raw values).
topic | topic handle |
type_len | length of type string (output) |
NT_Publisher NT_Publish | ( | NT_Topic | topic, |
enum NT_Type | type, | ||
const char * | typeStr, | ||
const struct NT_PubSubOptions * | options | ||
) |
Creates a new publisher to a topic.
topic | topic handle |
type | type |
typeStr | type string |
options | publish options |
NT_Publisher NT_PublishEx | ( | NT_Topic | topic, |
enum NT_Type | type, | ||
const char * | typeStr, | ||
const char * | properties, | ||
const struct NT_PubSubOptions * | options | ||
) |
Creates a new publisher to a topic.
topic | topic handle |
type | type |
typeStr | type string |
properties | initial properties (JSON object) |
options | publish options |
void NT_Release | ( | NT_Handle | pubsubentry | ) |
Stops entry/subscriber/publisher.
pubsubentry | entry/subscriber/publisher handle |
void NT_ReleaseEntry | ( | NT_Entry | entry | ) |
Stops entry subscriber/publisher.
entry | entry handle |
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).
topic | topic handle |
value | True for cached, false for not cached |
Sets the persistent property of a topic.
If true, the stored value is persistent through server restarts.
topic | topic handle |
value | True for persistent, false for not persistent. |
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.
topic | topic handle |
properties | JSON object string with keys to add/update/delete |
Sets a property value.
topic | topic handle |
name | property name |
value | property value (JSON string) |
Sets the retained property of a topic.
If true, the server retains the topic even when there are no publishers.
topic | topic handle |
value | new retained property value |
NT_Subscriber NT_Subscribe | ( | NT_Topic | topic, |
enum NT_Type | type, | ||
const char * | typeStr, | ||
const struct NT_PubSubOptions * | options | ||
) |
Creates a new subscriber to value changes on a topic.
topic | topic handle |
type | expected type |
typeStr | expected type string |
options | subscription options |
void NT_Unpublish | ( | NT_Handle | pubentry | ) |
Stops publisher.
pubentry | publisher/entry handle |
void NT_Unsubscribe | ( | NT_Subscriber | sub | ) |
Stops subscriber.
sub | subscriber handle |