データの保存、更新、取得ができるWebサービス「milkcocoa」に接続し、データのプッシュ、送信、取得ができるライブラリです。EthernetIF版 https://mlkcca.com/
Dependents: MilkcocoaSample_Eth_tmp MilkcocoaSample_Eth uhuru_hallowin2
Fork of Milkcocoa by
Revision 7:026ece31eed4, committed 2017-10-31
- Comitter:
- jksoft
- Date:
- Tue Oct 31 09:24:11 2017 +0000
- Parent:
- 6:7b9d1fed76fe
- Child:
- 8:bf455cd5059f
- Commit message:
- ??
Changed in this revision
--- a/MQTT.lib Mon Feb 29 09:14:58 2016 +0000 +++ b/MQTT.lib Tue Oct 31 09:24:11 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/jksoft/code/MQTT/#f9841b2adaa2 +https://developer.mbed.org/users/jksoft/code/MQTT/#72e447b79a6f
--- a/Milkcocoa.cpp Mon Feb 29 09:14:58 2016 +0000
+++ b/Milkcocoa.cpp Tue Oct 31 09:24:11 2017 +0000
@@ -96,7 +96,7 @@
client = _client;
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);
@@ -108,7 +108,7 @@
client = _client;
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);
@@ -121,6 +121,10 @@
return new Milkcocoa(_client, host, port, _app_id, client_id, session);
}
+int Milkcocoa::getConnectStatus() {
+ return client->isConnected();
+}
+
void Milkcocoa::connect() {
if(client->isConnected())
--- a/Milkcocoa.h Mon Feb 29 09:14:58 2016 +0000 +++ b/Milkcocoa.h Tue Oct 31 09:24:11 2017 +0000 @@ -46,14 +46,14 @@ bool push(const char *path, DataElement dataelement); bool send(const char *path, DataElement dataelement); bool on(const char *path, const char *event, GeneralFunction cb); - + int getConnectStatus(); private: char servername[64]; int16_t portnum; char _clientid[64]; char username[32]; char password[32]; - const char *app_id; + char app_id[32]; MClient *client; GeneralFunction _cb;
