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

Class for interacting with Adafruit IO Grouped Feeds https://io.adafruit.com/api/docs/mqtt.html#group-topics. More...

#include <AdafruitIO_Group.h>

Inheritance diagram for AdafruitIO_Group:
AdafruitIO_MQTT

Public Member Functions

 AdafruitIO_Group (AdafruitIO *io, const char *name)
 Creates a new instance of an Adafruit IO Group. More...
 
 ~AdafruitIO_Group ()
 Adafruit IO Group destructor.
 
void set (const char *feed, char *value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, bool value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, String value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, int value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, unsigned int value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, long value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, unsigned long value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, float value)
 Sets value of Adafruit IO Group. More...
 
void set (const char *feed, double value)
 Sets value of Adafruit IO Group. More...
 
bool save ()
 Updates value of Adafruit IO Group. More...
 
bool get ()
 Publishes null value ("\0") to Adafruit IO Group https://io.adafruit.com/api/docs/mqtt.html#retained-values. More...
 
void setLocation (double lat=0, double lon=0, double ele=0)
 Sets up locational metadata. More...
 
bool exists ()
 Checks if Adafruit IO Group exists. https://io.adafruit.com/api/docs/#get-group. More...
 
bool create ()
 Creates new Adafruit IO Group. https://io.adafruit.com/api/docs/#create-group. More...
 
void onMessage (AdafruitIODataCallbackType cb)
 Sets up Adafruit IO callback to monitor incoming new data in group. More...
 
void onMessage (const char *feed, AdafruitIODataCallbackType cb)
 Sets up Adafruit IO callback to monitor incoming new data in group's feed, feed. More...
 
void subCallback (char *val, uint16_t len)
 Checks for new value within Adafruit IO group. More...
 
void call (AdafruitIO_Data *d)
 Adafruit IO Group subscription function callback. More...
 
AdafruitIO_DatagetFeed (const char *feed)
 Obtains data from feed within group. More...
 

Public Attributes

const char * name
 
const char * owner
 
AdafruitIO_Datadata
 

Friends

class AdafruitIO_Group
 AdafruitIO_Group addition.
 

Detailed Description

Class for interacting with Adafruit IO Grouped Feeds https://io.adafruit.com/api/docs/mqtt.html#group-topics.

Constructor & Destructor Documentation

◆ AdafruitIO_Group()

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

Creates a new instance of an Adafruit IO Group.

Parameters
*ioReference to AdafruitIO.
*nValid group name.

Member Function Documentation

◆ set() [1/9]

void AdafruitIO_Group::set ( const char *  feed,
char *  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [2/9]

void AdafruitIO_Group::set ( const char *  feed,
bool  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [3/9]

void AdafruitIO_Group::set ( const char *  feed,
String  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [4/9]

void AdafruitIO_Group::set ( const char *  feed,
int  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [5/9]

void AdafruitIO_Group::set ( const char *  feed,
unsigned int  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [6/9]

void AdafruitIO_Group::set ( const char *  feed,
long  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [7/9]

void AdafruitIO_Group::set ( const char *  feed,
unsigned long  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [8/9]

void AdafruitIO_Group::set ( const char *  feed,
float  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ set() [9/9]

void AdafruitIO_Group::set ( const char *  feed,
double  value 
)

Sets value of Adafruit IO Group.

Parameters
feedAdafruit IO feed name.
valueAdafruit IO feed value.

◆ save()

bool AdafruitIO_Group::save ( )

Updates value of Adafruit IO Group.

Returns
True if successfully published to group, False if data is NULL or if unable to successfully publish data to group.

◆ get()

bool AdafruitIO_Group::get ( )

Publishes null value ("\0") to Adafruit IO Group https://io.adafruit.com/api/docs/mqtt.html#retained-values.

Returns
True if successfully published to group, False otherwise.

◆ setLocation()

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

Sets up locational metadata.

Parameters
latDesired latitude.
lonDesired longitude.
eleDesired elevation.

◆ exists()

bool AdafruitIO_Group::exists ( )

Checks if Adafruit IO Group exists. https://io.adafruit.com/api/docs/#get-group.

Returns
True if successful, otherwise False.

◆ create()

bool AdafruitIO_Group::create ( )

Creates new Adafruit IO Group. https://io.adafruit.com/api/docs/#create-group.

Returns
True if successful, otherwise False.

◆ onMessage() [1/2]

void AdafruitIO_Group::onMessage ( AdafruitIODataCallbackType  cb)

Sets up Adafruit IO callback to monitor incoming new data in group.

Parameters
cbAn function to be called if group receives new data.

◆ onMessage() [2/2]

void AdafruitIO_Group::onMessage ( const char *  feed,
AdafruitIODataCallbackType  cb 
)

Sets up Adafruit IO callback to monitor incoming new data in group's feed, feed.

Parameters
feedAn Adafruit IO Feed within Group.
cbAn function to be called if group receives new data.

◆ subCallback()

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

Checks for new value within Adafruit IO group.

Parameters
valValue to send to Adafruit IO group.
lenLength of Adafruit IO value.

Implements AdafruitIO_MQTT.

◆ call()

void AdafruitIO_Group::call ( AdafruitIO_Data d)

Adafruit IO Group subscription function callback.

Parameters
dName of feed within group.

◆ getFeed()

AdafruitIO_Data * AdafruitIO_Group::getFeed ( const char *  feed)

Obtains data from feed within group.

Parameters
feedExisting Adafruit IO Feed.
Returns
cur_data Data from feed within group data Adafruit IO Feed does not exist in group. Data is the value of a generated feed, feed, within group. NULL If unable to return data.

Member Data Documentation

◆ name

const char* AdafruitIO_Group::name

Adafruit IO group name.

◆ owner

const char* AdafruitIO_Group::owner

Adafruit IO username of group owner.

◆ data

AdafruitIO_Data* AdafruitIO_Group::data

Adafruit IO data record.


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