add Feed method to Adafruit IO
This commit is contained in:
parent
40a03cd8b4
commit
4037d90bcd
2 changed files with 11 additions and 2 deletions
|
|
@ -22,6 +22,11 @@ void AdafruitIO::connect(const __FlashStringHelper *user, const __FlashStringHel
|
|||
|
||||
}
|
||||
|
||||
AdafruitIO_Feed* AdafruitIO::Feed(const char* name)
|
||||
{
|
||||
return new AdafruitIO_Feed(this, name);
|
||||
}
|
||||
|
||||
void AdafruitIO::_init()
|
||||
{
|
||||
|
||||
|
|
@ -73,7 +78,7 @@ void AdafruitIO::_init()
|
|||
|
||||
}
|
||||
|
||||
void AdafruitIO::setErrorHandler(AdafruitIOErrorCallbackType cb)
|
||||
void AdafruitIO::setErrorHandler(SubscribeCallbackBufferType cb)
|
||||
{
|
||||
_subscriptions[0]->setCallback(cb);
|
||||
_subscriptions[1]->setCallback(cb);
|
||||
|
|
|
|||
|
|
@ -4,17 +4,21 @@
|
|||
#include "Arduino.h"
|
||||
#include "Adafruit_MQTT.h"
|
||||
#include "AdafruitIO_Definitions.h"
|
||||
#include "AdafruitIO_Feed.h"
|
||||
|
||||
class AdafruitIO {
|
||||
|
||||
friend class AdafruitIO_Feed;
|
||||
|
||||
public:
|
||||
AdafruitIO();
|
||||
|
||||
void connect(const char *user, const char *key);
|
||||
void connect(const __FlashStringHelper *user, const __FlashStringHelper *key);
|
||||
void run();
|
||||
void setErrorHandler(AdafruitIOErrorCallbackType cb);
|
||||
void setErrorHandler(SubscribeCallbackBufferType cb);
|
||||
|
||||
AdafruitIO_Feed* Feed(const char *name);
|
||||
const __FlashStringHelper* statusText();
|
||||
|
||||
aio_status_t status();
|
||||
|
|
|
|||
Loading…
Reference in a new issue