Ambient library. It provides "set" function to set data to a packet and "send" function to send the packet to the Ambient server. It also provides "bulk_send" function to send multiple data. (Japanese: IoT用のクラウドサービス「Ambient」のデーター送信ライブラリーです。Ambientはマイコンから送られたセンサーデーターを受信し、蓄積し、可視化(グラフ化)します。http://ambidata.io)

Dependents:   AmbientExampleSITB AmbientHeartRateMonitor AmbientHeartBeat AmbientExampleSITB_ws ... more

Files at this revision

API Documentation at this revision

Comitter:
AmbientData
Date:
Mon Jun 06 11:41:56 2016 +0000
Parent:
0:7dca16f75bae
Child:
2:a319af936fd5
Commit message:
Change Class name from AMBIENT to Ambient

Changed in this revision

Ambient.cpp Show annotated file Show diff for this revision Revisions of this file
Ambient.h Show annotated file Show diff for this revision Revisions of this file
--- a/Ambient.cpp	Sat May 07 01:40:02 2016 +0000
+++ b/Ambient.cpp	Mon Jun 06 11:41:56 2016 +0000
@@ -17,11 +17,11 @@
 
 const char * ambient_keys[] = {"\"d1\":\"", "\"d2\":\"", "\"d3\":\"", "\"d4\":\"", "\"d5\":\"", "\"d6\":\"", "\"d7\":\"", "\"d8\":\"", "\"lat\":\"", "\"lng\":\"", "\"created\":\""};
 
-AMBIENT::AMBIENT() {
+Ambient::Ambient() {
 }
 
 bool
-AMBIENT::init(unsigned int channelId, const char * writeKey, TCPSocketConnection * s, int dev) {
+Ambient::init(unsigned int channelId, const char * writeKey, TCPSocketConnection * s, int dev) {
     this->channelId = channelId;
 
     if (sizeof(writeKey) > AMBIENT_WRITEKEY_SIZE) {
@@ -50,7 +50,7 @@
 }
 
 bool
-AMBIENT::set(int field, char * data) {
+Ambient::set(int field, char * data) {
     --field;
     if (field < 0 || field >= AMBIENT_NUM_PARAMS) {
         return false;
@@ -65,7 +65,7 @@
 }
 
 bool
-AMBIENT::clear(int field) {
+Ambient::clear(int field) {
     --field;
     if (field < 0 || field >= AMBIENT_NUM_PARAMS) {
         return false;
@@ -76,7 +76,7 @@
 }
 
 bool
-AMBIENT::send() {
+Ambient::send() {
 
     int retry;
     for (retry = 0; retry < AMBIENT_MAX_RETRY; retry++) {
--- a/Ambient.h	Sat May 07 01:40:02 2016 +0000
+++ b/Ambient.h	Mon Jun 06 11:41:56 2016 +0000
@@ -1,5 +1,5 @@
-#ifndef AMBIENT_H
-#define AMBIENT_H
+#ifndef Ambient_h
+#define Ambient_h
 
 #include "mbed.h"
 #include "TCPSocketConnection.h"
@@ -9,7 +9,7 @@
 #define AMBIENT_DATA_SIZE 24
 #define AMBIENT_NUM_PARAMS 11
 
-/** AMBIENT class
+/** Ambient class
  * to send data to Ambient service.
  *
  * Exsample:
@@ -21,7 +21,7 @@
  * 
  * unsigned int channelId = 100;
  * const char* writeKey = "ライトキー";
- * AMBIENT ambient;
+ * Ambient ambient;
  * 
  * HDC1000      hdc1000(p9,p10);
  * 
@@ -58,12 +58,12 @@
  * }
  * @endcode
  */
-class AMBIENT
+class Ambient
 {
 public:
-    /** Create AMBIENT instance
+    /** Create Ambient instance
      */
-    AMBIENT(void);
+    Ambient(void);
 
     /** Initialize the instance
      * @param channelId Initialize the Ambient instance with channelId.
@@ -109,4 +109,4 @@
     } data[AMBIENT_NUM_PARAMS];
 };
 
-#endif // AMBIENT_H
\ No newline at end of file
+#endif // Ambient_h
\ No newline at end of file