parse-community / parse-embedded-sdks

The Embedded SDKs for the Parse Platform
http://parseplatform.org
Other
246 stars 118 forks source link

Cloud function not getting executed in loop #58

Open abhirocks550 opened 8 years ago

abhirocks550 commented 8 years ago

I have created cloud function using Parse.com Javascript SDK and i am calling those functions from Arduino.Following is code for function hello

Parse.Cloud.define("hello", function(request, response) { response.success("This is hello function");
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

 Bridge.begin();
 Serial.begin(9600);

 while(!Serial);

 Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
      //commented my keys with * here only

 // In this example, we associate this device with a pre-generated installation
 Parse.getInstallationId();
 Parse.startPushService();

}

void loop() {

      Serial.println("Start loop");
      demoBasic("meeting",0);

}

void demoBasic(String functionname,int light){

  char fnname[11];
  functionname.toCharArray(fnname,11);

 Serial.print("In ");
 Serial.print(functionname);
 Serial.println(" Function");

 ParseCloudFunction cloudFunction;
 cloudFunction.setFunctionName(fnname);
 cloudFunction.add("light_sensor", light);
 cloudFunction.add("value", "Arduino Hello");//parameters

 ParseResponse response = cloudFunction.send();
 Serial.println(response.getJSONBody());

}//function block for demoBasic

Problem is that i am getting response 8 times only after that whole program flow gets blocked.What is the problem,can somebody help please?