diff -Nur open2300-1.10/ham2300.c open2300-1.10/ham2300.c --- open2300-1.10/ham2300.c 2006-07-24 16:10:03.000000000 +1200 +++ open2300-1.10/ham2300.c 2006-07-31 09:28:46.000000000 +1200 @@ -28,7 +28,8 @@ struct config_type config; unsigned char urlline[3000] = ""; char datestring[50]; //used to hold the date stamp for the log file - double tempfloat; + double tempfloat_a; + double tempfloat_b; time_t basictime; get_configuration(&config, argv[1]); @@ -53,11 +54,11 @@ /* READ WIND SPEED AND DIRECTION - miles/hour for Hamweather */ - sprintf(urlline,"%s&winddir=%.f", urlline, tempfloat); - sprintf(urlline,"%s&windspeedmph=%.1f", urlline, - wind_current(ws2300, MILES_PER_HOUR, &tempfloat) ); + tempfloat_a = wind_current(ws2300, MILES_PER_HOUR, &tempfloat_b); + sprintf(urlline,"%s&winddir=%.f", urlline, tempfloat_b); + sprintf(urlline,"%s&windspeedmph=%.1f", urlline, tempfloat_a); - /* WRITE 0 windgust information (in case value required) */ + /* WRITE 0 windgust information (in case value required) */ sprintf(urlline,"%s&windgust=0.0", urlline); @@ -93,9 +94,9 @@ sprintf(urlline,"%s&dailyrainin=%.2f", urlline, rain_24h(ws2300, INCHES) ); - */ + */ - /* WRITE blank weather and cloud information (in case value required) */ + /* WRITE blank weather and cloud information (in case value required) */ sprintf(urlline,"%s&weather=%%20", urlline); sprintf(urlline,"%s&clouds=%%20", urlline); @@ -117,7 +118,7 @@ } else { - http_request_url(urlline); + http_request_url(urlline, HAMWEATHER_BASEURL); } return(0); diff -Nur open2300-1.10/linux2300.c open2300-1.10/linux2300.c --- open2300-1.10/linux2300.c 2005-03-05 21:26:58.000000000 +1300 +++ open2300-1.10/linux2300.c 2006-07-31 09:10:56.000000000 +1200 @@ -235,13 +235,14 @@ * * Inputs: urlline - URL to Weather Underground with path and data * as a pointer to char array (string) + * baseurl - hostname of site to send data to * * Returns: 0 on success and -1 if fail. * - * Action: Send a http request to Weather Underground + * Action: Send a http request to a weather site * ********************************************************************/ -int http_request_url(char *urlline) +int http_request_url(char *urlline, char *baseurl) { int sockfd; struct hostent *hostinfo; @@ -249,7 +250,7 @@ char buffer[1024]; int bytes_read; - if ( (hostinfo = gethostbyname(WEATHER_UNDERGROUND_BASEURL)) == NULL ) + if ( (hostinfo = gethostbyname(baseurl)) == NULL ) { perror("Host not known by DNS server or DNS server not working"); return(-1); diff -Nur open2300-1.10/open2300-dist.conf open2300-1.10/open2300-dist.conf --- open2300-1.10/open2300-dist.conf 2006-07-24 16:10:03.000000000 +1200 +++ open2300-1.10/open2300-dist.conf 2006-07-31 09:20:43.000000000 +1200 @@ -52,7 +52,7 @@ WEATHER_UNDERGROUND_PASSWORD WUPASSWORD # Password for Weather Underground -#### HAMWEATHER variables (used only by wu2300) +#### HAMWEATHER variables (used only by ham2300) HAMWEATHER_ID HAMID # ID received from Hamweather HAMWEATHER_PASSWORD HAMPASSWORD # Password for Hamweather diff -Nur open2300-1.10/rw2300.h open2300-1.10/rw2300.h --- open2300-1.10/rw2300.h 2006-07-24 16:10:03.000000000 +1200 +++ open2300-1.10/rw2300.h 2006-07-31 09:06:42.000000000 +1200 @@ -312,7 +312,7 @@ int write_device(WEATHERSTATION serdevice, unsigned char *buffer, int size); void sleep_short(int milliseconds); void sleep_long(int seconds); -int http_request_url(char *urlline); +int http_request_url(char *urlline, char *baseurl); int citizen_weather_send(struct config_type *config, char *datastring); #endif /* _INCLUDE_RW2300_H_ */ diff -Nur open2300-1.10/win2300.c open2300-1.10/win2300.c --- open2300-1.10/win2300.c 2005-03-05 21:28:22.000000000 +1300 +++ open2300-1.10/win2300.c 2006-07-31 09:10:22.000000000 +1200 @@ -229,15 +229,16 @@ /******************************************************************** * http_request_url - Windows version * - * Inputs: urlline - URL to Weather Underground with path and data + * Inputs: urlline - URL to Weather site with path and data * as a pointer to char array (string) + * baseurl - hostname of site to send data to * * Returns: 0 on success and -1 if fail. * - * Action: Send a http request to Weather Underground + * Action: Send a http request to a weather site * ********************************************************************/ -int http_request_url(char *urlline) +int http_request_url(char *urlline, char *baseurl) { WORD wVersionRequested; WSADATA wsaData; @@ -267,7 +268,7 @@ return(-1); } - if ( (hostinfo = gethostbyname(WEATHER_UNDERGROUND_BASEURL)) == NULL ) + if ( (hostinfo = gethostbyname(baseurl)) == NULL ) { perror("Host not known by DNS server or DNS server not working"); return(-1); diff -Nur open2300-1.10/wu2300.c open2300-1.10/wu2300.c --- open2300-1.10/wu2300.c 2005-03-05 21:28:35.000000000 +1300 +++ open2300-1.10/wu2300.c 2006-07-31 09:12:03.000000000 +1200 @@ -106,7 +106,7 @@ } else { - http_request_url(urlline); + http_request_url(urlline, WEATHER_UNDERGROUND_BASEURL); } return(0);