Adafruit IO Arduino Library
Public Member Functions | Public Attributes | Friends | List of all members
AdafruitIO_Feed Class Reference

Class that provides methods for interfacing with Adafruit IO feed topics. https://io.adafruit.com/api/docs/mqtt.html#mqtt-topics. More...

#include <AdafruitIO_Feed.h>

Inheritance diagram for AdafruitIO_Feed:
AdafruitIO_MQTT

Public Member Functions

 AdafruitIO_Feed (AdafruitIO *io, const char *name)
 Creates a new instance of an Adafruit IO Feed. More...
 
 AdafruitIO_Feed (AdafruitIO *io, const char *name, const char *owner)
 Creates a new instance of an Adafruit IO Feed. More...
 
 ~AdafruitIO_Feed ()
 Adafruit IO Feed destructor.
 
bool save (char *value, double lat=0, double lon=0, double ele=0)
 Updates Adafruit IO Feed. More...
 
bool save (bool value, double lat=0, double lon=0, double ele=0)
 Updates Adafruit IO Feed. More...
 
bool save (String value, double lat=0, double lon=0, double ele=0)
 Updates Adafruit IO Feed. More...
 
bool save (int value, double lat=0, double lon=0, double ele=0)
 Updates Adafruit IO Feed. More...
 
bool save (unsigned int value, double lat=0, double lon=0, double ele=0)
 Updates Adafruit IO Feed. More...
 
bool save (long value, double lat=0, double lon=0, double ele=0)
 Updates Adafruit IO Feed. More...
 
bool save (unsigned long value, double lat=0, double lon=0, double ele=0)
 Updates Adafruit IO Feed. More...
 
bool save (float value, double lat=0, double lon=0, double ele=0, int precision=6)
 Updates Adafruit IO Feed. More...
 
bool save (double value, double lat=0, double lon=0, double ele=0, int precision=6)
 Updates Adafruit IO Feed. More...
 
bool get ()
 Publishes a null character to an Adafruit IO /get topic. https://io.adafruit.com/api/docs/mqtt.html#using-the-get-topic. More...
 
bool exists ()
 Checks if Adafruit IO Feed exists and belongs to username. https://io.adafruit.com/api/docs/#get-feed. More...
 
bool create ()
 Creates a new Adafruit IO Feed https://io.adafruit.com/api/docs/#create-feed. More...
 
void setLocation (double lat, double lon, double ele=0)
 Sets Adafruit IO feed location metadata. More...
 
void onMessage (AdafruitIODataCallbackType cb)
 Creates a new onMessage callback. More...
 
void subCallback (char *val, uint16_t len)
 Calls _datacallback if new data is avaliable on feed. More...
 
AdafruitIO_DatalastValue ()
 Retrieves the most recent value published to a feed. https://io.adafruit.com/api/docs/mqtt.html#using-the-get-topic. More...
 

Public Attributes

const char * name
 
const char * owner
 
AdafruitIO_Datadata
 

Friends

class AdafruitIO_Feed
 AdafruitIO_Feed addition.
 

Detailed Description

Class that provides methods for interfacing with Adafruit IO feed topics. https://io.adafruit.com/api/docs/mqtt.html#mqtt-topics.

Constructor & Destructor Documentation

◆ AdafruitIO_Feed() [1/2]

AdafruitIO_Feed::AdafruitIO_Feed ( AdafruitIO io,
const char *  n 
)

Creates a new instance of an Adafruit IO Feed.

Parameters
*ioReference to AdafruitIO.
*nValid feed name.

◆ AdafruitIO_Feed() [2/2]

AdafruitIO_Feed::AdafruitIO_Feed ( AdafruitIO io,
const char *  n,
const char *  un 
)

Creates a new instance of an Adafruit IO Feed.

Parameters
*ioReference to AdafruitIO.
*nValid feed name.
*unFeed owner's Adafruit IO username.

Member Function Documentation

◆ save() [1/9]

bool AdafruitIO_Feed::save ( char *  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [2/9]

bool AdafruitIO_Feed::save ( bool  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [3/9]

bool AdafruitIO_Feed::save ( String  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [4/9]

bool AdafruitIO_Feed::save ( int  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [5/9]

bool AdafruitIO_Feed::save ( unsigned int  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [6/9]

bool AdafruitIO_Feed::save ( long  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [7/9]

bool AdafruitIO_Feed::save ( unsigned long  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [8/9]

bool AdafruitIO_Feed::save ( float  value,
double  lat = 0,
double  lon = 0,
double  ele = 0,
int  precision = 6 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
precisionDesired amount of decimal precision.
Returns
True if data successfully published to feed, False otherwise.

◆ save() [9/9]

bool AdafruitIO_Feed::save ( double  value,
double  lat = 0,
double  lon = 0,
double  ele = 0,
int  precision = 6 
)

Updates Adafruit IO Feed.

Parameters
valueValue to publish to feed.
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.
precisionDesired amount of decimal precision.
Returns
True if data successfully published to feed, False otherwise.

◆ get()

bool AdafruitIO_Feed::get ( )

Publishes a null character to an Adafruit IO /get topic. https://io.adafruit.com/api/docs/mqtt.html#using-the-get-topic.

Returns
True if successful, otherwise False.

◆ exists()

bool AdafruitIO_Feed::exists ( )

Checks if Adafruit IO Feed exists and belongs to username. https://io.adafruit.com/api/docs/#get-feed.

Returns
True if successful, otherwise False.

◆ create()

bool AdafruitIO_Feed::create ( )

Creates a new Adafruit IO Feed https://io.adafruit.com/api/docs/#create-feed.

Returns
True if successful, otherwise False.

◆ setLocation()

void AdafruitIO_Feed::setLocation ( double  lat,
double  lon,
double  ele = 0 
)

Sets Adafruit IO feed location metadata.

Parameters
latLatitude metadata.
lonLongitudinal metadata.
eleElevation metadata.

◆ onMessage()

void AdafruitIO_Feed::onMessage ( AdafruitIODataCallbackType  cb)

Creates a new onMessage callback.

Parameters
cbAdafruit IO callback.

◆ subCallback()

void AdafruitIO_Feed::subCallback ( char *  val,
uint16_t  len 
)
virtual

Calls _datacallback if new data is avaliable on feed.

Parameters
valValue to publish to Adafruit IO feed.
lenFeed length.

Implements AdafruitIO_MQTT.

◆ lastValue()

AdafruitIO_Data * AdafruitIO_Feed::lastValue ( )

Retrieves the most recent value published to a feed. https://io.adafruit.com/api/docs/mqtt.html#using-the-get-topic.

Last value sent to Adafruit IO feed.

Returns
NULL

Member Data Documentation

◆ name

const char* AdafruitIO_Feed::name

Adafruit IO feed name.

◆ owner

const char* AdafruitIO_Feed::owner

Adafruit IO feed owner.

◆ data

AdafruitIO_Data* AdafruitIO_Feed::data

Adafruit IO feed data record.


The documentation for this class was generated from the following files: