mbed based IoT Gateway More details http://blog.thiseldo.co.uk/wp-filez/IoTGateway.pdf
Dependencies: NetServices FatFileSystem csv_parser mbed MQTTClient RF12B DNSResolver SDFileSystem
Diff: Outputs/OutputPachube.h
- Revision:
- 4:d460406ac780
- Parent:
- 0:a29a0225f203
- Child:
- 5:0dbc27a7af55
--- a/Outputs/OutputPachube.h Fri Apr 20 19:32:34 2012 +0000 +++ b/Outputs/OutputPachube.h Tue May 01 21:43:40 2012 +0000 @@ -38,6 +38,8 @@ #define DATABUF_SIZE 128 +#define PACHUBE_URL "http://api.pachube.com/v2/feeds/%d.csv?_method=PUT" + /** Output definition class for sending readings to Pachube */ class OutputPachube { @@ -45,12 +47,20 @@ /** Default Constructor */ OutputPachube(); + + /** Alternative Constructor + * + * @param internalBufferStart An internal buffer used to build up requests. + * @param url Pointer to API Url + * @param key Pointer to API key + */ + OutputPachube( char *internalBufferStart, char *url, char *key ); /** Set the API Key to use for sending readings to Pachube * * @param key Pointer to API key */ - void setApiKey( char *key ); +// void setApiKey( char *key ); /** Initialise output definition object */ @@ -71,11 +81,11 @@ virtual int send(); protected: - bool newReading; int sendCount; // Pachube config + char *apiUrl; char *apiKey; - char dataBuffer[DATABUF_SIZE]; + char *dataBuffer; // Pointer to start of databuffer char *dbufPtr; int currentFeed; };