2015-10-13 53 views
0

我正在开发一个项目,在该项目中,我需要读取和写入从Azure移动服务到Arduino的特定列和行的数据。简而言之,我需要通过Arduino将数据读取和写入Azure移动服务。写作部分已经完成了很多工作,但是我在阅读数据时遇到了一些问题。使用Azure移动服务从Arduino接收数据

这里是我的方案 1:Arduino的上传传感器数据到Azure移动服务(接近完成) 2:开发一个Windows Phone的应用从蔚蓝的移动服务访问数据(竞争) 3:开发一个Windows Phone的应用程序将数据写入天蓝色表(已完成) 4:使用上述步骤中写入的数据来控制我的Arduino(STUCK)

任何帮助将不胜感激。

回答

0

假设你有一个HTTP客户端做你的Arduino休息,你可以这样做以下:

字符串读(字符串表){ HttpClient的HTTP;

http_header_t headers[] = { 
    { "X-ZUMO-APPLICATION", "applicationKeyHere" }, 
    { "Content-Type", "application/json" }, 
    { NULL, NULL } // NOTE: Always terminate headers with NULL 
}; 

http_request_t request; 
http_response_t response; 

request.hostname = "mobileservicename.azure-mobile.net"; 
request.port = 80; 
request.path = "/tables/" + table; //update with your table name 

http.get(request, response, headers); 

return response.body; 

}

+0

非常感谢。我能解决这个问题。 –