Nyx Node
Loading...
Searching...
No Matches
nyx_node_t Struct Reference

Opaque struct describing a Nyx node. More...

#include <nyx_node.h>

Public Types

enum  nyx_event_type_t
 TCP or MQTT event type. More...
 
typedef void(* nyx_mqtt_handler_t) (nyx_node_t *node, nyx_event_type_t event_type, size_t topic_size, BUFF_t topic_buff, size_t message_size, BUFF_t message_buff)
 MQTT event handler.
 

Public Member Functions

__NYX_NULLABLE__ nyx_node_tnyx_node_initialize (STR_t node_id, nyx_dict_t *vectors[], __NYX_NULLABLE__ STR_t indi_url, __NYX_NULLABLE__ STR_t mqtt_url, __NYX_NULLABLE__ STR_t nss_url, __NYX_NULLABLE__ STR_t mqtt_username, __NYX_NULLABLE__ STR_t mqtt_password, __NYX_NULLABLE__ nyx_mqtt_handler_t mqtt_handler, uint32_t retry_ms, bool enable_xml)
 Allocates and initializes a new Nyx node.
 
void nyx_node_finalize (nyx_node_t *node, bool free_vectors)
 Finalizes a Nyx node.
 
void nyx_node_add_timer (const nyx_node_t *node, uint32_t interval_ms, void(*callback)(void *), void *arg)
 Add a new timer.
 
void nyx_node_poll (const nyx_node_t *node, uint32_t timeout_ms)
 Performs a single poll iteration.
 
bool nyx_node_notify (__NYX_NULLABLE__ nyx_object_t *object)
 Notifies the provided Nyx / INDI object to the clients.
 
void nyx_node_enable (const nyx_node_t *node, STR_t device, __NYX_NULLABLE__ STR_t name, __NYX_NULLABLE__ STR_t message)
 Enables a device or a vector and notifies clients.
 
void nyx_node_disable (const nyx_node_t *node, STR_t device, __NYX_NULLABLE__ STR_t name, __NYX_NULLABLE__ STR_t message)
 Disables a device or a vector and notifies clients.
 
void nyx_node_send_message (const nyx_node_t *node, STR_t device, __NYX_NULLABLE__ STR_t message)
 Sends a human-oriented message to the clients.
 
void nyx_node_send_del_property (const nyx_node_t *node, STR_t device, __NYX_NULLABLE__ STR_t name, __NYX_NULLABLE__ STR_t message)
 Sends a del-property message to the clients.
 
void nyx_mqtt_sub (const nyx_node_t *node, STR_t topic, int qos)
 If MQTT is enabled, subscribes to an MQTT topic.
 
void nyx_mqtt_pub (const nyx_node_t *node, STR_t topic, __NYX_ZEROABLE__ size_t message_size, __NYX_NULLABLE__ BUFF_t message_buff, int qos)
 If MQTT is enabled, publishes an MQTT message.
 
void nyx_nss_pub (const nyx_node_t *node, STR_t device, STR_t stream, __NYX_ZEROABLE__ size_t n_fields, const uint32_t field_hashes[], const size_t field_sizes[], const buff_t field_buffs[])
 If Nyx-Stream is enabled, publishes an entry to a stream.
 

Detailed Description

Opaque struct describing a Nyx node.


The documentation for this struct was generated from the following file: