【mbed OS5対応バージョン】データの保存、更新、取得ができるWebサービス「milkcocoa」に接続し、データのプッシュ、送信、取得ができるライブラリです。 https://mlkcca.com/

Dependents:   mbed-os-example-wifi-milkcocoa MilkcocoaOsSample_Eth MilkcocoaOsSample_ESP8266 MilkcocoaOsSample_Eth_DigitalIn

Files at this revision

API Documentation at this revision

Comitter:
jksoft
Date:
Fri May 19 01:25:04 2017 +0000
Parent:
3:cddf81a87de3
Child:
5:dd68fa651637
Commit message:
??????

Changed in this revision

Milkcocoa.cpp Show annotated file Show diff for this revision Revisions of this file
Milkcocoa.h Show annotated file Show diff for this revision Revisions of this file
--- a/Milkcocoa.cpp	Thu May 18 14:47:30 2017 +0000
+++ b/Milkcocoa.cpp	Fri May 19 01:25:04 2017 +0000
@@ -92,7 +92,7 @@
 	client = new MClient(ipstack);
 	strcpy(servername,host);
 	portnum = port;
-	app_id = _app_id;
+	strcpy(app_id,app_id);
 	strcpy(_clientid,client_id);
 	strcpy(username,"sdammy");
 	strcpy(password,app_id);
@@ -107,7 +107,7 @@
 	client = new MClient(ipstack);
 	strcpy(servername,host);
 	portnum = port;
-	app_id = _app_id;
+	strcpy(app_id,app_id);
 	strcpy(_clientid,client_id);
 	strcpy(username,_session);
 	strcpy(password,app_id);
@@ -173,7 +173,7 @@
 
 	sprintf(message->topic, "%s/%s/push", app_id, path);
 	
-	strcpy(message->message , "{\"params\":{");
+	strcpy(message->message , "{\"params\":");
 	strcat(message->message , data);
 	strcat(message->message , "}");
 	
@@ -209,7 +209,7 @@
 
 	sprintf(message->topic, "%s/%s/send", app_id, path);
 	
-	strcpy(message->message , "{\"params\":{");
+	strcpy(message->message , "{\"params\":");
 	strcat(message->message , data);
 	strcat(message->message , "}");
 	
--- a/Milkcocoa.h	Thu May 18 14:47:30 2017 +0000
+++ b/Milkcocoa.h	Fri May 19 01:25:04 2017 +0000
@@ -58,7 +58,7 @@
   char _clientid[64];
   char username[32];
   char password[32];
-  const char *app_id;
+  char app_id[32];
   int16_t loop_cycle;
 
   MQTTInterface* ipstack;