18#ifndef AGENT_C_WRAPPER_HPP
19#define AGENT_C_WRAPPER_HPP
27#define MADS_EXPORT __declspec(dllexport)
284 const char *info_json);
MADS_EXPORT bool mads_process_running(void)
Whether a process-wide stop has been requested.
MADS_EXPORT void agent_set_client_key_name(agent_t agent, const char *client_key_name)
Sets the client key filename.
MADS_EXPORT int agent_set_settings_timeout(agent_t agent, int to_ms)
Sets the timeout used when fetching settings.
MADS_EXPORT void mads_free(void *ptr)
Releases memory allocated by the MADS C API.
MADS_EXPORT void agent_set_receive_timeout(agent_t agent, int timeout)
Sets the receive timeout in milliseconds.
MADS_EXPORT int agent_sub_topics(agent_t agent, char **topics, size_t *n_topics)
Return subscription topics for the agent.
MADS_EXPORT void agent_destroy(agent_t agent)
Destroys an agent instance.
MADS_EXPORT int agent_set_server_public_key(agent_t agent, const char *key)
Sets the server public key.
MADS_EXPORT const char * mads_default_settings_uri()
Returns the default settings URI compiled into the library.
MADS_EXPORT void agent_print_settings(agent_t agent, int tab)
Prints the current settings JSON to standard output.
MADS_EXPORT double agent_setting_dbl(agent_t agent, const char *key)
Reads a floating-point setting.
MADS_EXPORT bool agent_setting_bool(agent_t agent, const char *key)
Reads a boolean setting.
MADS_EXPORT const char * agent_settings_uri(agent_t agent)
Returns the current settings URI.
MADS_EXPORT int agent_set_compression(agent_t agent, int compression)
Sets the outgoing compression policy.
MADS_EXPORT bool agent_running(agent_t agent)
Whether this agent's loops should keep going.
MADS_EXPORT int agent_set_wire_format(agent_t agent, int format)
Sets the outgoing wire format.
MADS_EXPORT const char * agent_setting_str(agent_t agent, const char *key)
Reads a string setting.
MADS_EXPORT int agent_settings_timeout(agent_t agent)
Returns the current settings timeout.
MADS_EXPORT const char * agent_id(agent_t agent)
Returns the current agent identifier.
MADS_EXPORT void agent_set_pub_topic(agent_t agent, const char *topic)
Sets the publish topic for the agent.
MADS_EXPORT int agent_set_client_public_key(agent_t agent, const char *key)
Sets the client public key.
MADS_EXPORT agent_t agent_create(const char *name, const char *settings_uri)
Creates a new agent instance.
MADS_EXPORT void agent_set_auth_verbose(agent_t agent, bool verbose)
Enables or disables verbose authentication logging.
MADS_EXPORT int agent_set_client_secret_key(agent_t agent, const char *key)
Sets the client secret key.
MADS_EXPORT const char * agent_last_error()
Returns the last error message produced by the wrapper.
MADS_EXPORT int agent_setup_crypto(agent_t agent, bool verbose)
Enables CURVE encryption and sets up authentication.
MADS_EXPORT int agent_init(agent_t agent, bool crypto)
Initializes an agent before connecting it.
MADS_EXPORT char * agent_topics(agent_t agent, int tab)
MADS_EXPORT const char * agent_pub_topic(agent_t agent)
Return publishing topic for the agent.
MADS_EXPORT int agent_wire_format(agent_t agent)
Returns the outgoing wire format.
MADS_EXPORT void agent_install_loop_watchdog(agent_t agent)
Installs the internal loop watchdog for the agent.
MADS_EXPORT int agent_compression(agent_t agent)
Returns the outgoing compression policy.
MADS_EXPORT int agent_setting_int(agent_t agent, const char *key)
Reads an integer setting.
MADS_EXPORT void agent_last_message(agent_t agent, char **topic, char **message)
Returns the topic and payload of the last received message.
MADS_EXPORT void mads_stop_process(void)
Requests a process-wide stop.
MADS_EXPORT void agent_set_key_dir(agent_t agent, const char *key_dir)
Sets the directory containing authentication keys.
MADS_EXPORT int agent_connect(agent_t agent, int delay_ms)
Connects the agent to the MADS infrastructure.
MADS_EXPORT int agent_publish(agent_t agent, const char *message, const char *topic)
Publishes a JSON message on a topic.
MADS_EXPORT int agent_set_high_watermark(agent_t agent, int n)
Sets the outgoing message high watermark.
MADS_EXPORT void agent_set_server_key_name(agent_t agent, const char *server_key_name)
Sets the server key filename.
MADS_EXPORT int agent_receive_timeout(agent_t agent)
Returns the current receive timeout.
MADS_EXPORT void agent_set_id(agent_t agent, const char *id)
Sets the agent identifier.
MADS_EXPORT const char * agent_get_settings(agent_t agent, int n)
Serializes the current settings to JSON.
MADS_EXPORT int agent_disconnect(agent_t agent)
Disconnects the agent if it is connected.
MADS_EXPORT const char * mads_version()
Returns the MADS library version string.
MADS_EXPORT int agent_stop(agent_t agent)
Requests this agent's loops to stop.
MADS_EXPORT int discover_broker_settings(const char *room, char **url, size_t url_size)
Discovers the broker settings URI advertised in a service room.
MADS_EXPORT int agent_high_watermark(agent_t agent)
Returns the outgoing message high watermark.
MADS_EXPORT void agent_set_sub_topics(agent_t agent, const char **topics, int n_topics)
Sets the subscribe topics for the agent.
MADS_EXPORT message_type_t agent_receive(agent_t agent, bool dont_block)
Receives the next incoming message.
MADS_EXPORT int agent_register_event(agent_t agent, event_type_t event, const char *info_json)
Registers an event for the connected agent.