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

Class for interacting with Adafruit IO Data Records. https://io.adafruit.com/api/docs/#data. More...

#include <AdafruitIO_Data.h>

Public Member Functions

 AdafruitIO_Data ()
 Sets up an Adafruit IO Data Record.
 
 AdafruitIO_Data (AdafruitIO_Feed *f)
 Sets up an Adafruit IO Data Record. More...
 
 AdafruitIO_Data (AdafruitIO_Feed *f, char *csv)
 Sets up an Adafruit IO Data Record. More...
 
 AdafruitIO_Data (AdafruitIO_Feed *f, const char *csv)
 Sets up an Adafruit IO Data Record. More...
 
 AdafruitIO_Data (const char *f)
 Sets up an Adafruit IO Data Record. More...
 
 AdafruitIO_Data (const char *f, char *csv)
 Sets up an Adafruit IO Data Record. More...
 
bool setCSV (char *csv)
 Sets data to be returned by AdafruitIO_Feed subCallback. More...
 
bool setCSV (const char *csv)
 Sets data to be returned by AdafruitIO_Feed subCallback. More...
 
void setLocation (double lat, double lon, double ele=0)
 Sets Adafruit IO Feed location metadata. More...
 
void setValue (const char *value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (char *value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (bool value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (String value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (int value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (unsigned int value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (long value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (unsigned long value, double lat=0, double lon=0, double ele=0)
 Sets Adafruit IO Feed value field. More...
 
void setValue (float value, double lat=0, double lon=0, double ele=0, int precision=6)
 Sets Adafruit IO Feed value field. More...
 
void setValue (double value, double lat=0, double lon=0, double ele=0, int precision=6)
 Sets Adafruit IO Feed value field. More...
 
char * feedName ()
 Returns existing Adafruit IO feed name. More...
 
char * value ()
 Converts provided value to char. More...
 
char * toChar ()
 Converts value to char. More...
 
String toString ()
 Converts value to string. More...
 
bool toBool ()
 Converts value to Boolean. More...
 
bool isTrue ()
 Checks if value is True. More...
 
bool isFalse ()
 Checks if value is False. More...
 
int toInt ()
 Converts provided String value to Integer. More...
 
int toPinLevel ()
 Checks digital pin level. More...
 
unsigned int toUnsignedInt ()
 Converts value to to an Unsigned Integer value. More...
 
double toDouble ()
 Converts value to to a double value. More...
 
float toFloat ()
 Converts value to a floating point value. More...
 
long toLong ()
 Converts value to to a long value. More...
 
unsigned long toUnsignedLong ()
 Converts value to to an unsigned long value. More...
 
int toRed ()
 Returns RR from 0xRRGGBB value. More...
 
int toGreen ()
 Returns GG from 0xRRGGBB value. More...
 
int toBlue ()
 Returns BB from 0xRRGGBB value. More...
 
long toNeoPixel ()
 Creates a RGB Tuple usable by Adafruit_NeoPixel's setPixelColor method. More...
 
char * toCSV ()
 Creates a list of comma-separated-values for an Adafruit IO data record. More...
 
char * charFromDouble (double d, int precision=6)
 Converts from a character to a double. More...
 
double lat ()
 Returns a data record's latitude value. More...
 
double lon ()
 Returns a data record's longitude value. More...
 
double ele ()
 Returns a data record's elevation value. More...
 

Public Attributes

AdafruitIO_Datanext_data
 

Detailed Description

Class for interacting with Adafruit IO Data Records. https://io.adafruit.com/api/docs/#data.

Constructor & Destructor Documentation

◆ AdafruitIO_Data() [1/5]

AdafruitIO_Data::AdafruitIO_Data ( AdafruitIO_Feed f)

Sets up an Adafruit IO Data Record.

Parameters
*fA reference to an Adafruit IO Feed name.

◆ AdafruitIO_Data() [2/5]

AdafruitIO_Data::AdafruitIO_Data ( AdafruitIO_Feed f,
char *  csv 
)

Sets up an Adafruit IO Data Record.

Parameters
*fA reference to an Adafruit IO Feed name.
*csvA reference to a comma-separated-value list.

◆ AdafruitIO_Data() [3/5]

AdafruitIO_Data::AdafruitIO_Data ( AdafruitIO_Feed f,
const char *  csv 
)

Sets up an Adafruit IO Data Record.

Parameters
*fA reference to an Adafruit IO Feed name.
*csvA reference to a fixed comma-separated-value list

◆ AdafruitIO_Data() [4/5]

AdafruitIO_Data::AdafruitIO_Data ( const char *  f)

Sets up an Adafruit IO Data Record.

Parameters
*fA reference to a fixed Adafruit IO Feed name.

◆ AdafruitIO_Data() [5/5]

AdafruitIO_Data::AdafruitIO_Data ( const char *  f,
char *  csv 
)

Sets up an Adafruit IO Data Record.

Parameters
*fA reference to a fixed Adafruit IO Feed name.
*csvA reference to a comma-separated-value list

Member Function Documentation

◆ setCSV() [1/2]

bool AdafruitIO_Data::setCSV ( char *  csv)

Sets data to be returned by AdafruitIO_Feed subCallback.

Parameters
*csvData to be appended to csv
Returns
csv

◆ setCSV() [2/2]

bool AdafruitIO_Data::setCSV ( const char *  csv)

Sets data to be returned by AdafruitIO_Feed subCallback.

Parameters
*csvData to be appended to csv
Returns
True if the CSV was parsed successfully, False if not

◆ setLocation()

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

Sets Adafruit IO Feed location metadata.

Parameters
latLatitude value for feed datum.
lonLongitude value for feed datum.
eleElevation value for datum.

◆ setValue() [1/10]

void AdafruitIO_Data::setValue ( const char *  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field as a char.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [2/10]

void AdafruitIO_Data::setValue ( char *  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field as a char.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [3/10]

void AdafruitIO_Data::setValue ( bool  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field, as a boolean.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [4/10]

void AdafruitIO_Data::setValue ( String  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field as a String.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [5/10]

void AdafruitIO_Data::setValue ( int  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [6/10]

void AdafruitIO_Data::setValue ( unsigned int  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [7/10]

void AdafruitIO_Data::setValue ( long  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [8/10]

void AdafruitIO_Data::setValue ( unsigned long  value,
double  lat = 0,
double  lon = 0,
double  ele = 0 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.

◆ setValue() [9/10]

void AdafruitIO_Data::setValue ( float  value,
double  lat = 0,
double  lon = 0,
double  ele = 0,
int  precision = 6 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.
precisionDesired decimals of precision for value.

◆ setValue() [10/10]

void AdafruitIO_Data::setValue ( double  value,
double  lat = 0,
double  lon = 0,
double  ele = 0,
int  precision = 6 
)

Sets Adafruit IO Feed value field.

Parameters
valueData record's value field.
latData record's latitude field.
lonData record's longitude field.
eleData record's elevation field.
precisionDesired decimals of precision for value.

◆ feedName()

char * AdafruitIO_Data::feedName ( )

Returns existing Adafruit IO feed name.

Returns
Feed's name if feed exists.

◆ value()

char * AdafruitIO_Data::value ( )

Converts provided value to char.

Returns
Char value.

◆ toChar()

char * AdafruitIO_Data::toChar ( )

Converts value to char.

Returns
value.

◆ toString()

String AdafruitIO_Data::toString ( )

Converts value to string.

Returns
String of value.

◆ toBool()

bool AdafruitIO_Data::toBool ( )

Converts value to Boolean.

Returns
True if value string equals Boolean True, False if not.

◆ isTrue()

bool AdafruitIO_Data::isTrue ( )

Checks if value is True.

Returns
True if value string equals Boolean True, False if not.

◆ isFalse()

bool AdafruitIO_Data::isFalse ( )

Checks if value is False.

Returns
True if value string equals Boolean False, False if not.

◆ toInt()

int AdafruitIO_Data::toInt ( )

Converts provided String value to Integer.

Returns
Integer of value, False if no value provided.

◆ toPinLevel()

int AdafruitIO_Data::toPinLevel ( )

Checks digital pin level.

Returns
HIGH if digital pin level is Boolean True, LOW if digital pin level is False.

◆ toUnsignedInt()

unsigned int AdafruitIO_Data::toUnsignedInt ( )

Converts value to to an Unsigned Integer value.

Returns
Unsigned Integer, False if no value provided.

◆ toDouble()

double AdafruitIO_Data::toDouble ( )

Converts value to to a double value.

Returns
Double value, False if no value provided.

◆ toFloat()

float AdafruitIO_Data::toFloat ( )

Converts value to a floating point value.

Returns
Float value, False if no value provided.

◆ toLong()

long AdafruitIO_Data::toLong ( )

Converts value to to a long value.

Returns
long value, False if no value provided.

◆ toUnsignedLong()

unsigned long AdafruitIO_Data::toUnsignedLong ( )

Converts value to to an unsigned long value.

Returns
Unsigned long value, False if no value provided.

◆ toRed()

int AdafruitIO_Data::toRed ( )

Returns RR from 0xRRGGBB value.

Returns
Red hexadecimal value.

◆ toGreen()

int AdafruitIO_Data::toGreen ( )

Returns GG from 0xRRGGBB value.

Returns
Green hexadecimal value.

◆ toBlue()

int AdafruitIO_Data::toBlue ( )

Returns BB from 0xRRGGBB value.

Returns
Blue hexadecimal value.

◆ toNeoPixel()

long AdafruitIO_Data::toNeoPixel ( )

Creates a RGB Tuple usable by Adafruit_NeoPixel's setPixelColor method.

Returns
RGB tuple as a hexadecimal value.

◆ toCSV()

char * AdafruitIO_Data::toCSV ( )

Creates a list of comma-separated-values for an Adafruit IO data record.

Returns
_csv

◆ charFromDouble()

char * AdafruitIO_Data::charFromDouble ( double  d,
int  precision = 6 
)

Converts from a character to a double.

Parameters
dDouble value.
precisionDesired level of decimal precision.
Returns
_double_buffer

◆ lat()

double AdafruitIO_Data::lat ( )

Returns a data record's latitude value.

Returns
_lat

◆ lon()

double AdafruitIO_Data::lon ( )

Returns a data record's longitude value.

Returns
_lon

◆ ele()

double AdafruitIO_Data::ele ( )

Returns a data record's elevation value.

Returns
_ele

Member Data Documentation

◆ next_data

AdafruitIO_Data* AdafruitIO_Data::next_data

next data value in Adafruit IO data record


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