Microchip® Advanced Software Framework

mqtt.c File Reference
#include "MQTTClient/Wrapper/mqtt.h"
#include "string.h"

Functions

static void allocateClient (struct mqtt_module *module)
 
static void deAllocateClient (struct mqtt_module *module)
 
int mqtt_connect (struct mqtt_module *module, const char *host)
 Connect to specific MQTT broker server. More...
 
int mqtt_connect_broker (struct mqtt_module *const module, uint8_t clean_session, const char *id, const char *password, const char *client_id, const char *will_topic, const char *will_msg, uint32_t will_msg_len, uint8_t will_qos, uint8_t will_retain)
 Send MQTT connect message to broker server with MQTT parameter. More...
 
int mqtt_deinit (struct mqtt_module *module)
 Termivate MQTT service. More...
 
int mqtt_disconnect (struct mqtt_module *const module, int force_close)
 Send disconnect message to MQTT broker server and closing socket. More...
 
void mqtt_get_config_defaults (struct mqtt_config *const config)
 Get default configuration of SW timer. More...
 
int mqtt_init (struct mqtt_module *module, struct mqtt_config *config)
 Initialize MQTT service. More...
 
int mqtt_publish (struct mqtt_module *const module, const char *topic, const char *msg, uint32_t msg_len, uint8_t qos, uint8_t retain)
 Send publish message to MQTT broker server. More...
 
int mqtt_register_callback (struct mqtt_module *module, mqtt_callback_t callback)
 Register and enable the callback. More...
 
void mqtt_socket_event_handler (SOCKET sock, uint8_t msg_type, void *msg_data)
 Event handler of socket event. More...
 
void mqtt_socket_resolve_handler (uint8_t *domain_name, uint32_t server_ip)
 Event handler of gethostbyname. More...
 
int mqtt_subscribe (struct mqtt_module *module, const char *topic, uint8_t qos, messageHandler msgHandler)
 Send subscribe message to MQTT broker server. More...
 
int mqtt_unregister_callback (struct mqtt_module *module)
 Unregister callback. More...
 
int mqtt_unsubscribe (struct mqtt_module *module, const char *topic)
 Send unsubscribe message to MQTT broker server. More...
 
int mqtt_yield (struct mqtt_module *module, int timeout_ms)
 Poll for published frames. More...
 

Variables

struct mqtt_client_pool mqttClientPool [MQTT_MAX_CLIENTS] = {0,}
 Copyright (C) 2017 Microchip Technology Inc. More...
 

static void allocateClient ( struct mqtt_module module)
static
static void deAllocateClient ( struct mqtt_module module)
static