Everything works except AMPM and snooze
Dependencies: 4DGL-uLCD-SE EthernetInterface HTTPClient NTPClient PinDetect SDFileSystem mbed-rpc mbed-rtos mbed wave_player
Fork of ECE4180_FinalProject by
RPCType.cpp@9:add6ce18f1b7, 2014-12-03 (annotated)
- Committer:
- adaruna3
- Date:
- Wed Dec 03 17:59:07 2014 +0000
- Revision:
- 9:add6ce18f1b7
- Parent:
- 0:0a99e3fc2a46
All features working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
prabbat3 | 0:0a99e3fc2a46 | 1 | #include "mbed.h" |
prabbat3 | 0:0a99e3fc2a46 | 2 | #include "mbed_rpc.h" |
prabbat3 | 0:0a99e3fc2a46 | 3 | #include "RPCType.h" |
prabbat3 | 0:0a99e3fc2a46 | 4 | |
prabbat3 | 0:0a99e3fc2a46 | 5 | RPCType::RPCType(): supported_types(){} |
prabbat3 | 0:0a99e3fc2a46 | 6 | |
prabbat3 | 0:0a99e3fc2a46 | 7 | RPCType& RPCType::instance() |
prabbat3 | 0:0a99e3fc2a46 | 8 | { |
prabbat3 | 0:0a99e3fc2a46 | 9 | static RPCType t; |
prabbat3 | 0:0a99e3fc2a46 | 10 | return t; |
prabbat3 | 0:0a99e3fc2a46 | 11 | } |
prabbat3 | 0:0a99e3fc2a46 | 12 | |
prabbat3 | 0:0a99e3fc2a46 | 13 | void RPCType::register_types() |
prabbat3 | 0:0a99e3fc2a46 | 14 | { |
prabbat3 | 0:0a99e3fc2a46 | 15 | RPCType &t = instance(); |
prabbat3 | 0:0a99e3fc2a46 | 16 | RPC::add_rpc_class<RpcAlarm>(); |
prabbat3 | 0:0a99e3fc2a46 | 17 | t.supported_types.push_back("Alarm"); |
prabbat3 | 0:0a99e3fc2a46 | 18 | RPC::add_rpc_class<RpcDigitalOut>(); |
prabbat3 | 0:0a99e3fc2a46 | 19 | t.supported_types.push_back("DigitalOut"); |
prabbat3 | 0:0a99e3fc2a46 | 20 | } |
prabbat3 | 0:0a99e3fc2a46 | 21 | |
prabbat3 | 0:0a99e3fc2a46 | 22 | bool RPCType::is_supported_type(char *type) |
prabbat3 | 0:0a99e3fc2a46 | 23 | { |
prabbat3 | 0:0a99e3fc2a46 | 24 | for(std::list<char*>::iterator itor = instance().supported_types.begin(); |
prabbat3 | 0:0a99e3fc2a46 | 25 | itor != instance().supported_types.end(); |
prabbat3 | 0:0a99e3fc2a46 | 26 | ++itor) |
prabbat3 | 0:0a99e3fc2a46 | 27 | if(!strcmp(*itor,type)) |
prabbat3 | 0:0a99e3fc2a46 | 28 | return true; |
prabbat3 | 0:0a99e3fc2a46 | 29 | |
prabbat3 | 0:0a99e3fc2a46 | 30 | return false; |
prabbat3 | 0:0a99e3fc2a46 | 31 | } |
prabbat3 | 0:0a99e3fc2a46 | 32 | |
prabbat3 | 0:0a99e3fc2a46 | 33 |