ported HTTP-Server with W5500 Ethernet Shield
Dependencies: W5500Interface mbed-rpc mbed
Fork of HTTP-Server by
RPCType.cpp
00001 #include "mbed.h" 00002 #include "mbed_rpc.h" 00003 #include "RPCType.h" 00004 00005 00006 RPCType::RPCType(): 00007 supported_types() 00008 { 00009 } 00010 00011 RPCType& RPCType::instance() 00012 { 00013 static RPCType t; 00014 return t; 00015 } 00016 00017 void RPCType::register_types() 00018 { 00019 RPCType &t = instance(); 00020 00021 RPC::add_rpc_class<RpcDigitalOut>(); 00022 t.supported_types.push_back("DigitalOut"); 00023 RPC::add_rpc_class<RpcDigitalIn>(); 00024 t.supported_types.push_back("DigitalIn"); 00025 RPC::add_rpc_class<RpcDigitalInOut>(); 00026 t.supported_types.push_back("DigitalInOut"); 00027 00028 #if DEVICE_PWMOUT 00029 RPC::add_rpc_class<RpcPwmOut>(); 00030 t.supported_types.push_back("PwmOut"); 00031 #endif 00032 #if DEVICE_SPI 00033 t.supported_types.push_back("SPI"); 00034 RPC::add_rpc_class<RpcSPI>(); 00035 #endif 00036 #if DEVICE_SERIAL 00037 t.supported_types.push_back("Serial"); 00038 RPC::add_rpc_class<RpcSerial>(); 00039 #endif 00040 RPC::add_rpc_class<RpcTimer>(); 00041 t.supported_types.push_back("Timer"); 00042 } 00043 00044 bool RPCType::is_supported_type(char *type) 00045 { 00046 for(std::list<char*>::iterator itor = instance().supported_types.begin(); 00047 itor != instance().supported_types.end(); 00048 ++itor) 00049 if(!strcmp(*itor,type)) 00050 return true; 00051 00052 return false; 00053 } 00054 00055
Generated on Wed Jul 13 2022 21:09:03 by 1.7.2