ported HTTP-Server with W5500 Ethernet Shield

Dependencies:   W5500Interface mbed-rpc mbed

Fork of HTTP-Server by F B

Committer:
embeddist
Date:
Tue Apr 28 13:54:18 2015 +0000
Revision:
11:ac3569846176
Parent:
0:9e4bcb10b3e3
ported HTTP-Server with W5500 Ethernet Shield

Who changed what in which revision?

UserRevisionLine numberNew contents of line
feb11 0:9e4bcb10b3e3 1 #include "mbed.h"
feb11 0:9e4bcb10b3e3 2 #include "mbed_rpc.h"
feb11 0:9e4bcb10b3e3 3 #include "RPCType.h"
feb11 0:9e4bcb10b3e3 4
feb11 0:9e4bcb10b3e3 5
feb11 0:9e4bcb10b3e3 6 RPCType::RPCType():
feb11 0:9e4bcb10b3e3 7 supported_types()
feb11 0:9e4bcb10b3e3 8 {
feb11 0:9e4bcb10b3e3 9 }
feb11 0:9e4bcb10b3e3 10
feb11 0:9e4bcb10b3e3 11 RPCType& RPCType::instance()
feb11 0:9e4bcb10b3e3 12 {
feb11 0:9e4bcb10b3e3 13 static RPCType t;
feb11 0:9e4bcb10b3e3 14 return t;
feb11 0:9e4bcb10b3e3 15 }
feb11 0:9e4bcb10b3e3 16
feb11 0:9e4bcb10b3e3 17 void RPCType::register_types()
feb11 0:9e4bcb10b3e3 18 {
feb11 0:9e4bcb10b3e3 19 RPCType &t = instance();
feb11 0:9e4bcb10b3e3 20
feb11 0:9e4bcb10b3e3 21 RPC::add_rpc_class<RpcDigitalOut>();
feb11 0:9e4bcb10b3e3 22 t.supported_types.push_back("DigitalOut");
feb11 0:9e4bcb10b3e3 23 RPC::add_rpc_class<RpcDigitalIn>();
feb11 0:9e4bcb10b3e3 24 t.supported_types.push_back("DigitalIn");
feb11 0:9e4bcb10b3e3 25 RPC::add_rpc_class<RpcDigitalInOut>();
feb11 0:9e4bcb10b3e3 26 t.supported_types.push_back("DigitalInOut");
feb11 0:9e4bcb10b3e3 27
feb11 0:9e4bcb10b3e3 28 #if DEVICE_PWMOUT
feb11 0:9e4bcb10b3e3 29 RPC::add_rpc_class<RpcPwmOut>();
feb11 0:9e4bcb10b3e3 30 t.supported_types.push_back("PwmOut");
feb11 0:9e4bcb10b3e3 31 #endif
feb11 0:9e4bcb10b3e3 32 #if DEVICE_SPI
feb11 0:9e4bcb10b3e3 33 t.supported_types.push_back("SPI");
feb11 0:9e4bcb10b3e3 34 RPC::add_rpc_class<RpcSPI>();
feb11 0:9e4bcb10b3e3 35 #endif
feb11 0:9e4bcb10b3e3 36 #if DEVICE_SERIAL
feb11 0:9e4bcb10b3e3 37 t.supported_types.push_back("Serial");
feb11 0:9e4bcb10b3e3 38 RPC::add_rpc_class<RpcSerial>();
feb11 0:9e4bcb10b3e3 39 #endif
feb11 0:9e4bcb10b3e3 40 RPC::add_rpc_class<RpcTimer>();
feb11 0:9e4bcb10b3e3 41 t.supported_types.push_back("Timer");
feb11 0:9e4bcb10b3e3 42 }
feb11 0:9e4bcb10b3e3 43
feb11 0:9e4bcb10b3e3 44 bool RPCType::is_supported_type(char *type)
feb11 0:9e4bcb10b3e3 45 {
feb11 0:9e4bcb10b3e3 46 for(std::list<char*>::iterator itor = instance().supported_types.begin();
feb11 0:9e4bcb10b3e3 47 itor != instance().supported_types.end();
feb11 0:9e4bcb10b3e3 48 ++itor)
feb11 0:9e4bcb10b3e3 49 if(!strcmp(*itor,type))
feb11 0:9e4bcb10b3e3 50 return true;
feb11 0:9e4bcb10b3e3 51
feb11 0:9e4bcb10b3e3 52 return false;
feb11 0:9e4bcb10b3e3 53 }
feb11 0:9e4bcb10b3e3 54
feb11 0:9e4bcb10b3e3 55