8.1 Kombiniert das Übung 6.1 Licht bei Dämmerung einschalten mit RPC Variable um die Sensordaten via Client abzufragen.

Dependencies:   EthernetInterface HttpServer mbed-rpc mbed-rtos mbed

Fork of RPCHTTPServerVariable by th.iotkit2.ch

Revision:
5:bfa9878aa274
Parent:
4:155c6ff99458
Child:
6:c9c7ffa0594e
--- a/main.cpp	Fri Feb 21 07:42:20 2014 +0000
+++ b/main.cpp	Sat Feb 22 05:55:58 2014 +0000
@@ -5,16 +5,18 @@
 #include "HTTPServer.h"
 #include "mbed_rpc.h"
 #include "TextLCD.h"
+
 EthernetInterface eth;
 
 DigitalOut led4(LED4);
- 
-LocalFileSystem local("local"); 
-   void LcdWrite(Arguments* arg, Reply* r);    //ADD Here!!
- 
+
+LocalFileSystem local("local");
+void LcdWrite(Arguments* arg, Reply* r);    //ADD Here!!
+
 TextLCD lcd(p24, p26, p27, p28, p29, p30);
 
-void aliveState(void const *args) {
+void aliveState(void const *args)
+{
     while (true) {
         led4 = !led4;
         Thread::wait(1000);
@@ -26,16 +28,16 @@
     printf("********* PROGRAM START ***********\r\n");
     Thread thread(aliveState);
     RPC::add_rpc_class<RpcDigitalOut>();
-    RPC::construct<RpcDigitalOut, PinName, const char*>(LED1, "led1");  
-    RPC::construct<RpcDigitalOut, PinName, const char*>(LED2, "led2");  
-    RPC::construct<RpcDigitalOut, PinName, const char*>(LED3, "led3");  
+    RPC::construct<RpcDigitalOut, PinName, const char*>(LED1, "led1");
+    RPC::construct<RpcDigitalOut, PinName, const char*>(LED2, "led2");
+    RPC::construct<RpcDigitalOut, PinName, const char*>(LED3, "led3");
     RPCFunction rpcFunc(LcdWrite, "LcdWrite"); //ADD Here!!
-  lcd.cls();
+    lcd.cls();
     lcd.locate(0,0);
 
     printf("EthernetInterface Setting up...\r\n");
     if(eth.init()!=0) {                             //for DHCP Server
-    //if(eth.init(IPAddress,NetMasks,Gateway)!=0) { //for Static IP Address
+        //if(eth.init(IPAddress,NetMasks,Gateway)!=0) { //for Static IP Address
         printf("EthernetInterface Initialize Error \r\n");
         return -1;
     }