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
Diff: Ambient.cpp
- Revision:
- 4:fcbd652bbb7a
- Parent:
- 3:a724fe60de46
diff -r a724fe60de46 -r fcbd652bbb7a Ambient.cpp
--- a/Ambient.cpp Mon Jun 13 12:03:41 2016 +0000
+++ b/Ambient.cpp Wed Jan 25 12:28:14 2017 +0000
@@ -1,7 +1,7 @@
#include "Ambient.h"
#define AMBIENT_DEBUG 0
-#define SimpleIoTBoard 1
+#define SimpleIoTBoard 0
#if AMBIENT_DEBUG
#if SimpleIoTBoard
@@ -73,6 +73,20 @@
}
bool
+Ambient::set(int field, int data) {
+ char buf[12];
+ snprintf(buf, sizeof(buf), "%d", data);
+ return (set(field, buf));
+}
+
+bool
+Ambient::set(int field, double data) {
+ char buf[12];
+ snprintf(buf, sizeof(buf), "%f", data);
+ return (set(field, buf));
+}
+
+bool
Ambient::clear(int field) {
--field;
if (field < 0 || field >= AMBIENT_NUM_PARAMS) {
Takehiko Shimojima
Ambient