mbed IoT Gateway board demo. This program received wireless data from JeeNode and uploads to Pachube. http://www.skpang.co.uk/catalog/mbed-iot-gateway-board-p-1051.html Full kit: http://www.skpang.co.uk/catalog/mbed-iot-gateway-full-kit-p-1052.html

Dependencies:   EthernetNetIf mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PachubeV2CSV.h Source File

PachubeV2CSV.h

00001 /**
00002  * Pachube API interface driver. (Version 0.0.1)
00003  *
00004  * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
00005  * http://shinta.main.jp/
00006  */
00007 
00008 #ifndef _PACHUBE_V2_CSV_H_
00009 #define _PACHUBE_V2_CSV_H_
00010 
00011 #include "Pachube.h"
00012 
00013 class PachubeV2CSV : public Pachube {
00014 public:
00015 
00016     explicit PachubeV2CSV(std::string APIKEY);
00017 
00018     virtual ~PachubeV2CSV();
00019 
00020     /*
00021      * =================================================================
00022      *  Environments (feeds)
00023      * =================================================================
00024      */
00025 
00026     /**
00027      * List all available feeds: GET /v2/feeds
00028      *
00029      * @param page Integer indicating which page of results you are requesting.
00030      * @param per_page Integer defining how many results to return per page (1 to 1000).
00031      * @param content String parameter ('full' or 'summary') describing whether we want full or summary results. Full results means all datastream values are returned, summary just returns the environment meta data for each feed.
00032      * @param q Full text search parameter. Should return any feeds matching this string.
00033      * @param tag Returns feeds containing datastreams tagged with the search query.
00034      * @param user Returns feeds created by the user specified.
00035      * @param units Returns feeds containing datastreams with units specified by the search query.
00036      * @param status Possible values ('live', 'frozen', or 'all'). Whether to search for only live feeds, only frozen feeds, or all feeds. Defaults to all.
00037      * @param order Order of returned feeds. Possible values ('created_at', 'retrieved_at', or 'relevance').
00038      */
00039     virtual int listAllAvailableFeeds(
00040         int page,
00041         int per_page,
00042         std::string content,
00043         std::string q,
00044         std::string tag,
00045         std::string user,
00046         std::string units,
00047         std::string status,
00048         std::string order,
00049         std::string &datatext);
00050 
00051     /**
00052      * Create new feed: POST /v2/feeds
00053      */
00054     virtual int createNewFeed(void);
00055 
00056     /**
00057      * Read feed: GET /v2/feeds/<feed_id>
00058      */
00059     virtual int readFeed(int feed_id, std::string &datatext);
00060 
00061     /**
00062      * Update feed: PUT /v2/feeds/<feed_id>
00063      */
00064     virtual int updateFeed(int feed_id);
00065 
00066     /**
00067      * Delete feed: DELETE /v2/feeds/<feed_id>
00068      */
00069     virtual int deleteFeed(int feed_id);
00070 
00071     /*
00072      * =================================================================
00073      *  Datastreams
00074      * =================================================================
00075      */
00076 
00077     /**
00078      * Create new datastream: POST /v2/feeds/<feed_id>/datastreams
00079      *
00080      * @param feed_id Feed ID.
00081      * @param stream_id Stream ID text.
00082      * @param value value.
00083      *
00084      * @return Return code from a web server.
00085      */
00086     virtual int createNewDataStream(int feed_id, std::string stream_id, std::string value);
00087 
00088     /**
00089      * Read datastream - GET /v2/feeds/<feed_id>/datastreams/<datastream_id>
00090      *
00091      * @param feed_id Feed ID.
00092      * @param stream_id Stream ID text.
00093      *
00094      * @return Return code from a web server.
00095      */
00096     virtual int readDataStream(int feed_id, std::string stream_id, std::string &datatext);
00097 
00098     /**
00099      * Update datastream: PUT /v2/feeds/<feed_id>/datastreams/<datastream_id>
00100      *
00101      * @param feed_id Feed ID.
00102      * @param stream_id Stream ID text.
00103      * @param value value.
00104      *
00105      * @return Return code from a web server.
00106      */
00107     virtual int updateDataStream(int feed_id, std::string stream_id, std::string value);
00108 
00109     /**
00110      * Delete datastream: DELETE /v2/feeds/<feed_id>/datastreams/<datastream_id>
00111      *
00112      * @param feed_id Feed ID.
00113      * @param stream_id Stream ID text.
00114      *
00115      * @return Return code from a web server.
00116      */
00117     virtual int deleteDataStream(int feed_id, std::string stream_id);
00118 
00119 };
00120 
00121 #endif