This library provides data update method to Fastsensing.
Dependents: SCP1000_Fastsensing
Diff: Fastsensing.h
- Revision:
- 9:313790e8b56d
- Parent:
- 8:21b39074c0f5
- Child:
- 10:a7e8d865c53d
--- a/Fastsensing.h Fri May 19 01:09:19 2017 +0000 +++ b/Fastsensing.h Sun Jul 02 08:33:44 2017 +0000 @@ -27,17 +27,62 @@ #include "mbed.h" #include "EthernetInterface.h" -#include "HTTPClient.h" -class Fastsensing{ -private : - EthernetInterface eth; //eth instance is created from EthernetInterface - HTTPClient http; //http instance is created from HTTPClient -public: - int updateData(char *deviceId, char *channelId, double data); - int updateDataAll(char *deviceId, char *channelId[3], float data[3]); - void ethConnect(); - void ethDisconnect(); +/** Fastsensing Data Update class. + * You can update data to your Fastsensing account used this class. + * + * Example: + * @code + * #include "mbed.h" + * #include "Fastsensing.h" + * + * Fastsensing fast; + * AnalogIn illu(p20); + * DigitalOut myled(LED1); + * + * int main() + * { + * float lx = illu * 3.3 / 3 * 1000; + * printf("lx : %f\n", lx); + * for(int i = 0; i < 5; i++) { + * fast.updateData("UIYCOQAATQAO5AF7", channel[0], lx,1 ); + * wait(5.0); + * } + * while(1) { + * myled = 1; + * wait(0.5); + * myled = 0; + * wait(0.5); + * } + *} + * @endcode + */ +class Fastsensing { + private: + EthernetInterface eth; //create eth instance from Ethernet + + public: + /** + * Only one data update. + * @param *deviceId It is issued your dashboard on fastsening. Device ID length is 16 characters. + * @param *channelId It is issued your dashboard on fastsensing. Channel ID length is 8characters. + * @param data It is the data you want to update. + * @param display 1 is display your sent data and recieve data. 0 is not. + * @return + * 0 on success, -1 on deviceId length error, -2 on channelId length error + */ + int updateData(char *deviceId, char *channelId, double data, int display); + /** + * Only one data update. + * @param *deviceId It is issued your dashboard on fastsening. Device ID length is 16 characters. + * @param *channelId[3] These are issued your dashboard on fastsensing. Channel ID length is 8characters. + * @param data[3] These are the data you want to update. + * @param display 1 is display your sent data and recieve data. 0 is not. + * @return + * 0 on success, -1 on deviceId length error, -2 on channelId length error + */ + int updateDataAll(char *deviceId, char *channelId[3], float data[3], int display); + }; #endif \ No newline at end of file