User Manual

Connection Management
AdafruitMQTT can connect to an MQTT broker using both 'open' (unencrypted) or 'secure' (TLS/SSL encrypted)
connections.
bool connected(void)
Indicates if we are currently connected to the MQTT broker or not.
Parameters: None
Returns: 'True' (1) if we are connected to the MQTT broker, otherwise 'false' (0).
bool connect ( IPAddress ip, uint16_t port = 1883, bool cleanSession = true, uint16_t
bool connected ( void );
bool connect ( IPAddress ip,
uint16_t port = 1883,
bool cleanSession = true,
uint16_t keepalive_sec = MQTT_KEEPALIVE_DEFAULT);
bool connect ( const char* host,
uint16_t port = 1883,
bool cleanSession = true,
uint16_t keepalive_sec = MQTT_KEEPALIVE_DEFAULT);
bool connectSSL ( IPAddress ip,
uint16_t port = 8883,
bool cleanSession = true,
uint16_t keepalive_sec = MQTT_KEEPALIVE_DEFAULT);
bool connectSSL ( const char* host,
uint16_t port = 8883,
bool cleanSession = true,
uint16_t keepalive_sec = MQTT_KEEPALIVE_DEFAULT);
bool disconnect ( void );
bool publish ( UTF8String topic,
UTF8String message,
uint8_t qos = MQTT_QOS_AT_MOST_ONCE,
bool retained = false );
bool subscribe ( const char* topicFilter,
uint8_t qos,
messageHandler mh);
bool unsubscribe( const char* topicFilter );
void will ( const char* topic,
UTF8String message,
uint8_t qos = MQTT_QOS_AT_MOST_ONCE,
uint8_t retained = 0);
void clientID ( const char* client)
void setDisconnectCallback ( void (*fp) (void) )
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 110 of 202