User Manual
Setting a value here ensures that at least one message is sent between the client and the broker within every
'keep alive' period. If no data was sent within 'keepalive_sec' seconds, the Client will send a simple ping to the
broker to keep the connection alive. Setting this value to '0' disables the keep alive feature. The default value is
60 seconds.
Returns: 'True' (1) if the connection was successful, otherwise 'false' (0).
Feed Management
The following functions are available to work with AIO feeds:
bool updateFeed ( const char* feed, UTF8String message, uint8_t
qos=MQTT_QOS_AT_MOST_ONCE, bool retain=true )
Updates the value associated with the specified 'feed' ('topic' in MQTT terminology).
Parameters:
feed: The feed to update, not including the 'username/feeds/' prefix. So to work with 'username/feeds/onoff' you
should simply supply 'onoff' as the feedname.
qos: The quality of service level (see the MQTT spec for details). Default = 'At Most Once', meaning the message
tries to send once but isn't persisted if the send fails. Possible values are:
MQTT_QOS_AT_MOST_ONCE
MQTT_QOS_AT_LEAST_ONCE
MQTT_QOS_EXACTLY_ONCE
retained: Whether or not the published message should be 'retained' by the MQTT broker. Sending a message
with the retained bool set to 'false' (0) will clear any previously retained message from the broker. The default
value is false.
Returns: 'True' (1) if the feed was succesfully updated, otherwise 'false' (0).
bool followFeed ( const char* feed, uint8_t qos, messageHandler_t mh )
Follows (or 'subscribes' in MQTT terminology) to the specified AIO feed, which will cause the specific callback handler
function to fire every time the feed is changed on the AIO server.
Parameters:
feed: The feed to follow, not including the 'username/feeds/' prefix. So to work with 'username/feeds/onoff' you
should simply supply 'onoff' as the feedname.
qos: The quality of service level (see the MQTT spec for details). Default = 'At Most Once', meaning the message
tries to send once but isn't persisted if the send fails. Possible values are:
MQTT_QOS_AT_MOST_ONCE
MQTT_QOS_AT_LEAST_ONCE
MQTT_QOS_EXACTLY_ONCE
mh: The callback handler function to fire whenever the feed is changed. The callback handler should have the
following signature:
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 132 of 202










