Fork using ethernetinterface

Dependencies:   EthernetInterface HTTPClient ID12RFID mbed-rtos mbed

Fork of TweetRFID by Donatien Garnier

Revision:
5:5154c1a6442b
Parent:
4:45a7d7fc1161
--- a/main.cpp	Thu Aug 05 15:17:52 2010 +0000
+++ b/main.cpp	Fri Jan 18 17:17:01 2013 +0000
@@ -9,7 +9,7 @@
 
 #include "mbed.h"
 #include "ID12RFID.h"
-#include "EthernetNetIf.h"
+#include "EthernetInterface.h"
 #include "HTTPClient.h"
 
 #define TWITTER_USER "myusername"
@@ -19,7 +19,7 @@
 const int ids_list[IDS_COUNT] = {89481809, 89481810, 89481811};
 const char* names_list[IDS_COUNT] = {"Donatien", "Simon", "Dan"};
 
-EthernetNetIf ethernet;
+EthernetInterface ethernet;
 HTTPClient twitter;
 
 ID12RFID rfid(p14);
@@ -27,7 +27,8 @@
 DigitalOut tweet_ok(LED4);
 
 int main() {
-  ethernet.setup();
+  ethernet.init();
+  ethernet.connect();
   twitter.basicAuth(TWITTER_USER, TWITTER_PASSWORD);
 
   while(true) {
@@ -36,8 +37,8 @@
     for(int i = 0; i < IDS_COUNT; i++) {
       if (ids_list[i] == id) {
         HTTPMap msg;
-        msg["status"] = names_list[i];
-        msg["status"] += " just arrived home!";
+        msg.put("status", names_list[i]);
+        //msg["status"] += " just arrived home!";
         HTTPResult r = twitter.post("http://api.supertweet.net/1/statuses/update.xml", msg, NULL);
         tweet_ok = !r;
       }