User Manual
AdafruitAIOFeed
AdafruitAIOFeed is an optional helper class based on AdafruitMQTTTopic. It aims to make working with feeds in
Adafruit IO a bit easier, with the goal of implementing specialised classes that correspond to AIO feed types in the
future.
Constructor
AdafruitAIOFeed uses the following constructor:
Parameters:
aio: A reference to the AdafruitAIO class instance, which will be used when sending and receiving data to the
AIO server.
feed: A string containing the name of the AIO feed to work with, minus the 'username/feeds/' text which will be
automatically added by this class. For example, to work with 'testuser/feeds/status' you would provide 'status' to
the feed parameter.
qos: An optional quality of server (QoS) level to use when publishing. If left empty, this argument will default to
'At Most Once', meaning it will try to publish the data but if the operation fails it won't persist the attempt and retry
again later.
retain: Sets the 'retain' bit to indicate if any messages published to the MQTT broker should be retained on the
broker for the next client(s) that access that topic. By default this will be set to 'true' for AIO feeds.
Functions
The following functions are defined as part of AdafruitAIOFeed, but you also have access to the public functions that
are defined in AdafruitMQTTTopic since AdafruitAIOFeed class inherits from it.
bool follow (feedHandler_t fp)
Enables you to 'follow' this feed, meaning that you subscribe to any changes that are published to this feed on the AIO
server. To follow the feed, you simple set the callback handler, which is the function that will be called when this feed
changes in AIO.
Parameters:
Be sure to look at the documentation for AdafruitMQTTTopic as well, since this class is a specialized version
of that aimed at Adafruit IO.
AdafruitAIOFeed(AdafruitAIO* aio,
const char* feed,
uint8_t qos = MQTT_QOS_AT_MOST_ONCE,
bool retain = true)
bool follow ( feedHandler_t fp )
bool unfollow ( void )
bool followed ( void )
virtual size_t write ( const uint8_t *buf, size_t len )
virtual size_t write ( uint8_t ch )
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 138 of 202










