Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
Diff: MBEDToIOCResourceMap.cpp
- Revision:
- 25:2a001b4f7024
- Parent:
- 21:cfdaee0a2b50
- Child:
- 27:be7de89f3fa6
--- a/MBEDToIOCResourceMap.cpp Thu Feb 27 00:23:20 2014 +0000 +++ b/MBEDToIOCResourceMap.cpp Thu Feb 27 04:05:31 2014 +0000 @@ -33,9 +33,24 @@ // get our error handler ErrorHandler *MBEDToIOCResourceMap::logger() { return this->m_error_handler; } + + // get the IOC equivalent resource name from the Endpoint resource name + char *MBEDToIOCResourceMap::endpointNameToIOCName(char *mbed_name) { + bool found = false; + char *ioc_name = NULL; + + // lookup the IOC name and map it to an MBED (NSP) name + for(int i=0;i<NUM_MAPPINGS && !found && this->m_map[i] != NULL;++i) { + if (strcmp(this->m_map[i]->mbedName(),mbed_name) == 0) { + found = true; + ioc_name = this->m_map[i]->iocName(); + } + } + return ioc_name; + } - // lookup MBED equivalent to IOC input - char *MBEDToIOCResourceMap::getMBEDMappedName(char *ioc_name) { + // get the Endpoint resource name from the IOC resource name given + char *MBEDToIOCResourceMap::iocNameToEndpointName(char *ioc_name) { bool found = false; char *mbed_name = NULL;