Code written by Paul Rabbat, Angel Daruna, Jarel Hawkins, and Cordel Williams

Dependencies:   4DGL-uLCD-SE EthernetInterface HTTPClient NTPClient PinDetect SDFileSystem mbed-rpc mbed-rtos mbed wave_player

Fork of ECE4180_FinalProject by Angel Daruna

RPCType.cpp

Committer:
prabbat3
Date:
2014-12-07
Revision:
12:a99989062fee
Parent:
0:0a99e3fc2a46

File content as of revision 12:a99989062fee:

#include "mbed.h"
#include "mbed_rpc.h"
#include "RPCType.h"

RPCType::RPCType(): supported_types(){}

RPCType& RPCType::instance()
{
    static RPCType t;
    return t;
}

void RPCType::register_types()
{
    RPCType &t = instance();
    RPC::add_rpc_class<RpcAlarm>();
    t.supported_types.push_back("Alarm");
    RPC::add_rpc_class<RpcDigitalOut>();
    t.supported_types.push_back("DigitalOut");
}

bool RPCType::is_supported_type(char *type)
{
    for(std::list<char*>::iterator itor = instance().supported_types.begin();
        itor != instance().supported_types.end();
        ++itor)
        if(!strcmp(*itor,type))
            return true;

    return false;
}