Yalgaar mBed SDK for real-time messaging

Dependents:   YalgaarSDK

Fork of MQTT by Joerg Wende

Files at this revision

API Documentation at this revision

Comitter:
nileshvora
Date:
Tue Mar 14 11:17:54 2017 +0000
Parent:
3:511121ab8fef
Child:
5:7dde43328c25
Commit message:
Yalgaar SDK V1.0.0

Changed in this revision

PubSubClient.cpp Show annotated file Show diff for this revision Revisions of this file
yalgaar_api.cpp Show annotated file Show diff for this revision Revisions of this file
yalgaar_api.h Show annotated file Show diff for this revision Revisions of this file
--- a/PubSubClient.cpp	Tue Mar 14 05:03:22 2017 +0000
+++ b/PubSubClient.cpp	Tue Mar 14 11:17:54 2017 +0000
@@ -25,6 +25,10 @@
 
 PubSubClient::PubSubClient()
 {
+    this->_state = MQTT_DISCONNECTED;
+    this->ip = "api.yalgaar.io";
+    this->port = 1883;
+    this->t.start();
 }
 
 PubSubClient::PubSubClient(char *ip, int port)
--- a/yalgaar_api.cpp	Tue Mar 14 05:03:22 2017 +0000
+++ b/yalgaar_api.cpp	Tue Mar 14 11:17:54 2017 +0000
@@ -258,7 +258,7 @@
     connection_main_Callback=connectionCallback;
     snprintf(gclient_key,sizeof(gclient_key),"%s",(char *)clientKey);
     ret=connect(clientID);
-        wait(2.0f); 
+        wait(5.0f); 
     connection_state(ret);
     if (ret == 1)
         return SUCCESS;
@@ -397,7 +397,7 @@
     int error_code;
     char err_message[YALGAAR_ERROR_MESSAGE_LENGTH]= {0};
     if (ret == SUCCESS) {
-        connection_main_Callback("Connection success full");
+        connection_main_Callback("Connected successfully");
     } else {
         error_code = mqtt_state();
         enum_to_message(error_code,err_message);
@@ -446,6 +446,8 @@
  **********************************************************************************/
 void yalgaar::yalgaar_disconnect()
 {
-    connection_main_Callback("Client Successfully disconneted");
-    return disconnect();
+    
+    disconnect();
+    connection_main_Callback("Successfully disconneted");
+    return;
 }
\ No newline at end of file
--- a/yalgaar_api.h	Tue Mar 14 05:03:22 2017 +0000
+++ b/yalgaar_api.h	Tue Mar 14 11:17:54 2017 +0000
@@ -28,7 +28,7 @@
 
 
 
-#define YALGAAR_HOST                                "api.yalgaar.io"
+#define YALGAAR_HOST                                "192.168.60.6"
 #define YALGAAR_PORT                                1883
 
 extern int pubsub_error_code;