Dimitri Marechal / Mbed 2 deprecated Prow_push

Dependencies:   EthernetNetIf mbed

Files at this revision

API Documentation at this revision

Comitter:
mdimitri
Date:
Sun Jan 30 13:17:35 2011 +0000
Commit message:

Changed in this revision

EthernetNetIf.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClient.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Sun Jan 30 13:17:35 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Sun Jan 30 13:17:35 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d0be6af2d1db
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jan 30 13:17:35 2011 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+
+EthernetNetIf eth;
+
+int main() {
+
+  printf("Init\n");
+
+  printf("\r\nSetting up...\r\n");
+  EthernetErr ethErr = eth.setup();
+  if(ethErr)
+  {
+    printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+  printf("\r\nSetup OK\r\n");
+
+  HTTPClient prowl;
+  
+  HTTPMap msg;
+  msg["apikey"] = "";                   //your unique code you have to make on the website
+  msg["providerkey"] = "";
+  msg["priority"] = "0";
+  msg["application"] = "Mbed";
+  msg["event"] = "status";
+  msg["description"] = "Message sent from mbed";
+  
+  HTTPResult r = prowl.post("https://prowl.weks.net/publicapi/add", msg, NULL); 
+  if( r == HTTP_OK ){
+    printf("Push notification sent with success!\n");
+  }else{
+    printf("Problem during pushing, return code %d\n", r);
+  }
+   
+  return 0;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jan 30 13:17:35 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9a9732ce53a1