Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: NWSWeather.cpp
- Revision:
- 1:e077d6502c94
- Parent:
- 0:4435c965d95d
- Child:
- 2:eae60b64066e
--- a/NWSWeather.cpp Sun Mar 16 15:37:16 2014 +0000 +++ b/NWSWeather.cpp Sun Mar 16 16:03:57 2014 +0000 @@ -2,28 +2,28 @@ #include "NWSWeather.h" -static XMLItem_T WeatherData[] = { - {"observation_time_rfc822", isString, false, NULL}, - {"suggested_pickup", isString, false, NULL}, - {"suggested_pickup_period", isInt, false, 0}, - {"location", isString, false, NULL}, - {"weather", isString, false, NULL}, - {"temp_f", isFloat, false, 0}, - {"temp_c", isFloat, false, 0}, - {"relative_humidity", isInt, false, 0}, - {"wind_degrees", isInt, false, 0}, - {"wind_mph", isFloat, false, 0}, - {"pressure_mb", isFloat}, - {"pressure_in", isFloat, false, 0}, - {"dewpoint_f", isFloat}, - {"dewpoint_c", isFloat}, - {"windchill_f", isInt, false, 0}, - {"windchill_c", isInt, false, 0}, - {"visibility_mi", isFloat}, - {"icon_url_base", isString, false, NULL}, - {"icon_url_name", isString, false, NULL}, - {"latitude", isFloat, false, 0}, - {"longitude", isFloat, false, 0}, +static NWSWeather::XMLItem_T WeatherData[] = { + {"observation_time_rfc822", NWSWeather::isString}, + {"suggested_pickup", NWSWeather::isString}, + {"suggested_pickup_period", NWSWeather::isInt}, + {"location", NWSWeather::isString}, + {"weather", NWSWeather::isString}, + {"temp_f", NWSWeather::isFloat}, + {"temp_c", NWSWeather::isFloat}, + {"relative_humidity", NWSWeather::isInt}, + {"wind_degrees", NWSWeather::isInt}, + {"wind_mph", NWSWeather::isFloat}, + {"pressure_mb", NWSWeather::isFloat}, + {"pressure_in", NWSWeather::isFloat}, + {"dewpoint_f", NWSWeather::isFloat}, + {"dewpoint_c", NWSWeather::isFloat}, + {"windchill_f", NWSWeather::isFloat}, + {"windchill_c", NWSWeather::isFloat}, + {"visibility_mi", NWSWeather::isFloat}, + {"icon_url_base", NWSWeather::isString}, + {"icon_url_name", NWSWeather::isString}, + {"latitude", NWSWeather::isFloat}, + {"longitude", NWSWeather::isFloat}, }; #define MAXPARAMLEN 23 @@ -40,7 +40,7 @@ ClearWeatherRecords(); } -NWSReturnCode_T NWSWeather::setAlternateURL(const char * baseURL) +NWSWeather::NWSReturnCode_T NWSWeather::setAlternateURL(const char * baseURL) { if (m_baseurl) free(m_baseurl); @@ -59,7 +59,7 @@ return WeatherItemCount; } -NWSReturnCode_T NWSWeather::get(const char * site, int responseSize) +NWSWeather::NWSReturnCode_T NWSWeather::get(const char * site, int responseSize) { Timer timer; char *message = (char *)malloc(responseSize); @@ -93,7 +93,7 @@ } -NWSReturnCode_T NWSWeather::getParam(uint16_t i, char *name, Value_T *value, TypeOf_T *typeis) +NWSWeather::NWSReturnCode_T NWSWeather::getParam(uint16_t i, char *name, Value_T *value, TypeOf_T *typeis) { if (i < WeatherItemCount) { *name = *WeatherData[i].name; @@ -107,7 +107,7 @@ } -NWSReturnCode_T NWSWeather::isUpdated(uint16_t i) +NWSWeather::NWSReturnCode_T NWSWeather::isUpdated(uint16_t i) { if (i < WeatherItemCount && WeatherData[i].updated) return noerror; @@ -116,7 +116,7 @@ } -NWSReturnCode_T NWSWeather::getParam(const char *name, Value_T *value, TypeOf_T *typeis) +NWSWeather::NWSReturnCode_T NWSWeather::getParam(const char *name, Value_T *value, TypeOf_T *typeis) { if (value) { for (int i=0; i < WeatherItemCount; i++) { @@ -188,7 +188,7 @@ } } -NWSReturnCode_T NWSWeather::ParseWeatherRecord(char * p) +NWSWeather::NWSReturnCode_T NWSWeather::ParseWeatherRecord(char * p) { // <tag_name>value</tag_name> // p1 p2 p3