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: MBEDgps.cpp
- Revision:
- 155:582462821bd7
- Parent:
- 135:7f3f963cd159
- Child:
- 192:54b758a8eaaa
--- a/MBEDgps.cpp Thu Apr 03 00:50:36 2014 +0000 +++ b/MBEDgps.cpp Mon Apr 07 03:14:54 2014 +0000 @@ -35,6 +35,8 @@ MBEDEndpoint *endpoint = (MBEDEndpoint *)this->logger()->getEndpoint(); char buffer[PREFERENCE_VALUE_LEN+1]; memset(buffer,0,PREFERENCE_VALUE_LEN+1); - char *coords = endpoint->preferences()->getPreference("coords",buffer,PREFERENCE_VALUE_LEN,ENDPOINT_GPS_COORDS); + char *coords = ENDPOINT_GPS_COORDS; + if (endpoint != NULL && endpoint->preferences() != NULL) + coords = endpoint->preferences()->getPreference("coords",buffer,PREFERENCE_VALUE_LEN,ENDPOINT_GPS_COORDS); if (this->resource() != NULL && this->resource()->getValuePointer() != NULL) strcpy(this->resource()->getValuePointer(),coords); // fixed GPS for now... }