nsp specific components for the NSP version of the impact endpoint
Dependents: mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet mbed_nsp_endpoint_nxp
Diff: NSPLightResourceFactory.cpp
- Revision:
- 17:4fe123d805e3
- Parent:
- 13:6998d9c2410e
- Child:
- 18:0e32c41b238e
--- a/NSPLightResourceFactory.cpp Mon Apr 07 03:40:59 2014 +0000 +++ b/NSPLightResourceFactory.cpp Fri Apr 11 01:51:21 2014 +0000 @@ -63,6 +63,9 @@ // MBED supports observable location text #include "locationtext.h" + // MBEDEndpoint support + #include "MBEDEndpoint.h" + // default constructor NSPLightResourceFactory::NSPLightResourceFactory(ErrorHandler *error_handler,void *endpoint) : NSPResourceFactory(error_handler,endpoint) { } @@ -73,6 +76,8 @@ // create resources modeling a Light personality void NSPLightResourceFactory::createResources(char *ep_name) { + MBEDEndpoint *endpoint = (MBEDEndpoint *)this->getEndpoint(); + // record the endpoint name this->setEndpointName(ep_name); @@ -107,7 +112,7 @@ this->createResource(ep_name,"/sen/V","5.0",(void *)&voltage_cb,(sn_grs_resource_acl_e)SN_GRS_GET_ALLOWED,(void *)&init_voltage,(char *)NULL,"ucum:V"); this->createResource(ep_name,"/dev/V","5.0",(void *)&voltage_cb,(sn_grs_resource_acl_e)SN_GRS_GET_ALLOWED,(void *)&init_voltage,(char *)NULL,"ucum:V"); this->createResource(ep_name,"/gps/loc",ENDPOINT_GPS_COORDS,(void *)&gps_location_cb,(sn_grs_resource_acl_e)SN_GRS_GET_ALLOWED,(void *)&init_gps,"core#s","ns:gpsloc"); - this->createResource("/ns/nspaddr",NSP_ADDRESS,"core#s","ns:v4addr"); + this->createResource("/ns/nspaddr",endpoint->getNSPAddress(),"core#s","ns:v4addr"); this->createResource(ep_name,"/dev/panic","0",(void *)&switch_cb,(sn_grs_resource_acl_e)(SN_GRS_GET_ALLOWED),(void *)&init_switch,"core#s","ns:panic"); #ifdef MAC_ADDRESS