summaryrefslogtreecommitdiff
path: root/misc/open2300
diff options
context:
space:
mode:
authormartin <martin@pkgsrc.org>2004-11-11 10:19:29 +0000
committermartin <martin@pkgsrc.org>2004-11-11 10:19:29 +0000
commit4765d02762448b0eadff6abc59e44e88a4f08149 (patch)
treedf12a91af0521cc14e95b7b88c087834496a9c4f /misc/open2300
parentd7136839e3f1befb328f1b42918b576b16825913 (diff)
downloadpkgsrc-4765d02762448b0eadff6abc59e44e88a4f08149.tar.gz
Update open2300 to version 1.7 (and implicitly open2300-mysql too):
bugfix release to fix a buffer overrun. While there, add a few patches to disable checksum verification on wind direction - this failed for my weather station consistently on some data sets. I'll bring this up with the authors.
Diffstat (limited to 'misc/open2300')
-rw-r--r--misc/open2300/Makefile.common4
-rw-r--r--misc/open2300/distinfo15
-rw-r--r--misc/open2300/patches/patch-aa8
-rw-r--r--misc/open2300/patches/patch-ab535
-rw-r--r--misc/open2300/patches/patch-ad23
-rw-r--r--misc/open2300/patches/patch-ae13
-rw-r--r--misc/open2300/patches/patch-af13
-rw-r--r--misc/open2300/patches/patch-ag13
-rw-r--r--misc/open2300/patches/patch-ah13
9 files changed, 611 insertions, 26 deletions
diff --git a/misc/open2300/Makefile.common b/misc/open2300/Makefile.common
index cf98b2ebdf6..341154d17d6 100644
--- a/misc/open2300/Makefile.common
+++ b/misc/open2300/Makefile.common
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.common,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $
+# $NetBSD: Makefile.common,v 1.2 2004/11/11 10:19:29 martin Exp $
#
-DISTNAME= open2300-1.6
+DISTNAME= open2300-1.7
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=open2300/}
diff --git a/misc/open2300/distinfo b/misc/open2300/distinfo
index 3231f186389..a7d2b3ba060 100644
--- a/misc/open2300/distinfo
+++ b/misc/open2300/distinfo
@@ -1,7 +1,12 @@
-$NetBSD: distinfo,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $
+$NetBSD: distinfo,v 1.2 2004/11/11 10:19:29 martin Exp $
-SHA1 (open2300-1.6.tar.gz) = e6483c57126b85e3a8189d023cffe88902e928ed
-Size (open2300-1.6.tar.gz) = 327045 bytes
-SHA1 (patch-aa) = cc3948b297357939a23b55ea6dcd4505d5381d15
-SHA1 (patch-ab) = 0db92f0ab78ed6b5cd949123cee26b01e7d10ba8
+SHA1 (open2300-1.7.tar.gz) = 12227964e6a74f41c1efbbd58c4af67fc8ca3151
+Size (open2300-1.7.tar.gz) = 330103 bytes
+SHA1 (patch-aa) = f63fcb9632729e32750f6e1129e2011bbe5c4419
+SHA1 (patch-ab) = abf7bc87a25d1894ecc32d09ed48bd479f076fe3
SHA1 (patch-ac) = 5ddd6e4c0ce2df718c4fcb7efed1d9553c415684
+SHA1 (patch-ad) = 1075315c9eed8d97997b5aab82916772440332c0
+SHA1 (patch-ae) = 062f9d02e839c3c01a31d8b5ac6824a688742c2b
+SHA1 (patch-af) = eaeda5057a9d268c0034c0edff080bb488861296
+SHA1 (patch-ag) = 1239d4d60865e75aa61bba1f04e760c74e84d68c
+SHA1 (patch-ah) = 00d5dfd3a86691f7b2c0cef6360fc52103be6f17
diff --git a/misc/open2300/patches/patch-aa b/misc/open2300/patches/patch-aa
index 9b859a3d743..39980ad8176 100644
--- a/misc/open2300/patches/patch-aa
+++ b/misc/open2300/patches/patch-aa
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $
+$NetBSD: patch-aa,v 1.2 2004/11/11 10:19:29 martin Exp $
---- Makefile.orig 2004-04-23 17:35:30.000000000 +0200
-+++ Makefile 2004-11-04 09:28:14.000000000 +0100
+--- Makefile.orig 2004-08-01 11:51:08.000000000 +0200
++++ Makefile 2004-11-11 10:43:54.000000000 +0100
@@ -4,7 +4,7 @@
# Default locations are
# 1. Path to config file including filename given as parameter
@@ -22,7 +22,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $
@@ -37,7 +37,7 @@
- VERSION = 1.6
+ VERSION = 1.7
-CFLAGS = -Wall -O3 -DVERSION=\"$(VERSION)\"
+CFLAGS += -DVERSION=\"$(VERSION)\" -DSYSCONFDIR=\"$(PKG_SYSCONFDIR)\" -I /usr/pkg/include/mysql
diff --git a/misc/open2300/patches/patch-ab b/misc/open2300/patches/patch-ab
index 5c5e393265a..2134d32e91e 100644
--- a/misc/open2300/patches/patch-ab
+++ b/misc/open2300/patches/patch-ab
@@ -1,21 +1,526 @@
-$NetBSD: patch-ab,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $
+$NetBSD: patch-ab,v 1.2 2004/11/11 10:19:29 martin Exp $
---- rw2300.c.orig 2004-04-18 09:51:14.000000000 +0200
-+++ rw2300.c 2004-11-09 09:49:09.000000000 +0100
-@@ -2423,7 +2423,7 @@
+--- rw2300.c.orig 2004-08-01 11:51:08.000000000 +0200
++++ rw2300.c 2004-11-11 10:45:50.000000000 +0100
+@@ -9,6 +9,7 @@
+ * This program is published under the GNU General Public license
+ */
+
++#include <errno.h>
+ #include "rw2300.h"
+
+ /********************************************************************/
+@@ -30,7 +31,7 @@
+ int address=0x346;
+ int bytes=2;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ if (temperature_conv)
+@@ -70,7 +71,7 @@
+ int address=0x34B;
+ int bytes=15;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *temp_min = ((data[1]>>4)*10 + (data[1]&0xF) + (data[0]>>4)/10.0 +
+@@ -125,7 +126,7 @@
+ address=0x346;
+ number=2;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -137,7 +138,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -208,7 +209,7 @@
+ int address=0x373;
+ int bytes=2;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ if (temperature_conv)
+@@ -248,7 +249,7 @@
+ int address=0x378;
+ int bytes=15;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *temp_min = ((data[1]>>4)*10 + (data[1]&0xF) + (data[0]>>4)/10.0 +
+@@ -304,7 +305,7 @@
+ address=0x373;
+ number=2;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -316,7 +317,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -387,7 +388,7 @@
+ int address=0x3CE;
+ int bytes=2;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ if (temperature_conv)
+@@ -427,7 +428,7 @@
+ int address=0x3D3;
+ int bytes=15;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *dp_min = ((data[1]>>4)*10 + (data[1]&0xF) + (data[0]>>4)/10.0 +
+@@ -483,7 +484,7 @@
+ address=0x3CE;
+ number=2;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -495,7 +496,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -562,7 +563,7 @@
+ int address=0x3FB;
+ int bytes=1;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ return ((data[0] >> 4) * 10 + (data[0] & 0xF));
+@@ -591,7 +592,7 @@
+ int address=0x3FB;
+ int bytes=13;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *hum_min = (data[1] >> 4) * 10 + (data[1] & 0xF);
+@@ -638,7 +639,7 @@
+ address=0x3FB;
+ number=1;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -648,7 +649,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -715,7 +716,7 @@
+ int address=0x419;
+ int bytes=1;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ return ((data[0] >> 4) * 10 + (data[0] & 0xF));
+@@ -745,7 +746,7 @@
+ int address=0x419;
+ int bytes=13;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *hum_min = (data[1] >> 4) * 10 + (data[1] & 0xF);
+@@ -792,7 +793,7 @@
+ address=0x419;
+ number=1;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -802,7 +803,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -879,7 +880,7 @@
+
+ for (i=0; i<MAXWINDRETRIES; i++)
{
- if ((fptr = fopen("open2300.conf", "r")) == NULL)
- {
-- if ((fptr = fopen("/usr/local/etc/open2300.conf", "r")) == NULL)
-+ if ((fptr = fopen(SYSCONFDIR "/open2300.conf", "r")) == NULL)
- {
- if ((fptr = fopen("/etc/open2300.conf", "r")) == NULL)
- {
-@@ -2912,6 +2912,7 @@
-
- for (j = 0; j < MAXRETRIES; j++)
+- if (read_safe(ws2300, address, bytes, data, command)!=bytes) //Wind
++ if (read_safe(ws2300, address, bytes, data, command, 1)!=bytes) //Wind
+ read_error_exit();
+
+ if ( (data[0]!=0x00) || //Invalid wind data
+@@ -935,7 +936,12 @@
+
+ for (i=0; i<MAXWINDRETRIES; i++)
{
-+ if (j) sleep_long(2);
+- if (read_safe(ws2300, address, bytes, data, command)!=bytes) //Wind
++ // do not verify checksum here - the result is ~5.5 bytes
++ // and apparently the weather station calculates it differently
++ // than what we expect. example:
++ // 0x00, 0x00, 0xd0, 0xdd, 0xdd, 0x0a - with checksum 0x97
++ // instead of the expected 0x94.
++ if (read_safe(ws2300, address, bytes, data, command, 0)!=bytes) //Wind
+ read_error_exit();
+
+ if ( (data[0]!=0x00) || //Invalid wind data
+@@ -999,7 +1005,7 @@
+ int address=0x4EE;
+ int bytes=15;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ if (wind_min != NULL)
+@@ -1057,7 +1063,7 @@
+
+ for (i=0; i<MAXWINDRETRIES; i++)
+ {
+- if (read_safe(ws2300, address, number, data_read, command)!=number)
++ if (read_safe(ws2300, address, number, data_read, command, 1)!=number)
+ read_error_exit();
+
+ if ((data_read[0]!=0x00) || //Invalid wind data
+@@ -1083,7 +1089,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -1157,7 +1163,7 @@
+ int address=0x3A0;
+ int bytes=2;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ if (temperature_conv)
+@@ -1199,7 +1205,7 @@
+ int address=0x3A5;
+ int bytes=15;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *wc_min = ( (data[1]>>4)*10 + (data[1]&0xF) + (data[0]>>4)/10.0 +
+@@ -1255,7 +1261,7 @@
+ address=0x3A0;
+ number=2;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -1267,7 +1273,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -1337,7 +1343,7 @@
+ int address=0x4B4;
+ int bytes=3;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ return ( ((data[2] >> 4) * 1000 + (data[2] & 0xF) * 100 +
+@@ -1371,7 +1377,7 @@
+ int address=0x4B4;
+ int bytes=11;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *rain_max = ((data[5] >> 4) * 1000 + (data[5] & 0xF) * 100 +
+@@ -1415,7 +1421,7 @@
+ address=0x4B4;
+ number=3;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -1429,7 +1435,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -1516,7 +1522,7 @@
+ int address=0x497;
+ int bytes=3;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ return (((data[2] >> 4) * 1000 + (data[2] & 0xF) * 100 +
+@@ -1551,7 +1557,7 @@
+ int address=0x497;
+ int bytes=11;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *rain_max = ((data[5] >> 4) * 1000 + (data[5] & 0xF) * 100 +
+@@ -1595,7 +1601,7 @@
+ address=0x497;
+ number=3;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value[0] = data_read[0]&0xF;
+@@ -1609,7 +1615,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -1697,7 +1703,7 @@
+ int address=0x4D2;
+ int bytes=3;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ return (((data[2] >> 4) * 1000 + (data[2] & 0xF) * 100 +
+@@ -1730,7 +1736,7 @@
+ int address=0x4D2;
+ int bytes=8;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ time_since->minute = ((data[3] >> 4) * 10) + (data[3] & 0xF);
+@@ -1771,7 +1777,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -1822,7 +1828,7 @@
+ int address=0x5E2;
+ int bytes=3;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+
+@@ -1860,7 +1866,7 @@
+ int address=0x600;
+ int bytes=13;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *pres_min = ((data[2]&0xF)*1000 + (data[1]>>4)*100 +
+@@ -1874,7 +1880,7 @@
+ address=0x61E; //Relative pressure time and date for min/max
+ bytes=10;
+
+- if (read_safe(ws2300, address, bytes, data, command)!=bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1)!=bytes)
+ read_error_exit();
+
+ time_min->minute = ((data[0] >> 4) * 10) + (data[0] & 0xF);
+@@ -1911,7 +1917,7 @@
+ int address=0x5D8;
+ int bytes=3;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+
+@@ -1949,7 +1955,7 @@
+ int address=0x5F6;
+ int bytes=13;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *pres_min = ((data[2]&0xF)*1000 + (data[1]>>4)*100 +
+@@ -1963,7 +1969,7 @@
+ address=0x61E; //Relative pressure time and date for min/max
+ bytes=10;
+
+- if (read_safe(ws2300, address, bytes, data, command)!=bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1)!=bytes)
+ read_error_exit();
+
+ time_min->minute = ((data[0] >> 4) * 10) + (data[0] & 0xF);
+@@ -2009,7 +2015,7 @@
+ address=0x5D8;
+ number=8;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_value_abs[0] = data_read[0]&0xF;
+@@ -2028,7 +2034,7 @@
+ address=0x23B;
+ number=6;
+
+- if (read_safe(ws2300, address, number, data_read, command) != number)
++ if (read_safe(ws2300, address, number, data_read, command, 1) != number)
+ read_error_exit();
+
+ data_time[0] = data_read[0]&0xF;
+@@ -2112,7 +2118,7 @@
+ int address=0x5EC;
+ int bytes=3;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+
+@@ -2147,7 +2153,7 @@
+ const char *tendency_values[] = { "Steady", "Rising", "Falling" };
+ const char *forecast_values[] = { "Rainy", "Cloudy", "Sunny" };
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ strcpy(tendency, tendency_values[data[0] >> 4]);
+@@ -2180,7 +2186,7 @@
+ int address=0x6B2;
+ int bytes=10;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ *interval = (data[1] & 0xF)*256 + data[0] + 1;
+@@ -2244,7 +2250,7 @@
+
+ address = 0x6C6 + record*19;
+
+- if (read_safe(ws2300, address, bytes, data, command) != bytes)
++ if (read_safe(ws2300, address, bytes, data, command, 1) != bytes)
+ read_error_exit();
+
+ tempint = (data[4]<<12) + (data[3]<<4) + (data[2] >> 4);
+@@ -2767,7 +2773,8 @@
+ *
+ ********************************************************************/
+ int read_data(WEATHERSTATION ws2300, int address, int number,
+- unsigned char *readdata, unsigned char *commanddata)
++ unsigned char *readdata, unsigned char *commanddata,
++ int verify_checksum)
+ {
+
+ unsigned char answer;
+@@ -2806,8 +2813,10 @@
+ //Read and verify checksum
+ if (read_device(ws2300, &answer, 1) != 1)
+ return -1;
+- if (answer != data_checksum(readdata, number))
++ if (answer != data_checksum(readdata, number) && verify_checksum) {
++ errno = EIO; // make perror() output something meaningfull
+ return -1;
++ }
+
+ return i;
+
+@@ -2906,7 +2915,8 @@
+ *
+ ********************************************************************/
+ int read_safe(WEATHERSTATION ws2300, int address, int number,
+- unsigned char *readdata, unsigned char *commanddata)
++ unsigned char *readdata, unsigned char *commanddata,
++ int verify_checksum)
+ {
+ int j;
+
+@@ -2915,7 +2925,7 @@
reset_06(ws2300);
// Read the data. If expected number of bytes read break out of loop.
+- if (read_data(ws2300, address, number, readdata, commanddata)==number)
++ if (read_data(ws2300, address, number, readdata, commanddata, verify_checksum)==number)
+ {
+ break;
+ }
diff --git a/misc/open2300/patches/patch-ad b/misc/open2300/patches/patch-ad
new file mode 100644
index 00000000000..b63746b2eda
--- /dev/null
+++ b/misc/open2300/patches/patch-ad
@@ -0,0 +1,23 @@
+$NetBSD: patch-ad,v 1.1 2004/11/11 10:19:29 martin Exp $
+
+--- rw2300.h.orig 2004-04-14 03:41:10.000000000 +0200
++++ rw2300.h 2004-11-10 23:50:50.000000000 +0100
+@@ -283,14 +283,16 @@
+ void reset_06(WEATHERSTATION ws2300);
+
+ int read_data(WEATHERSTATION ws2300, int address, int number,
+- unsigned char *readdata, unsigned char *commanddata);
++ unsigned char *readdata, unsigned char *commanddata,
++ int verify_checksum);
+
+ int write_data(WEATHERSTATION ws2300, int address, int number,
+ unsigned char encode_constant, unsigned char *writedata,
+ unsigned char *commanddata);
+
+ int read_safe(WEATHERSTATION ws2300, int address, int number,
+- unsigned char *readdata, unsigned char *commanddata);
++ unsigned char *readdata, unsigned char *commanddata,
++ int verify_checksum);
+
+ int write_safe(WEATHERSTATION ws2300, int address, int number,
+ unsigned char encode_constant, unsigned char *writedata,
diff --git a/misc/open2300/patches/patch-ae b/misc/open2300/patches/patch-ae
new file mode 100644
index 00000000000..6d5ad0e3caa
--- /dev/null
+++ b/misc/open2300/patches/patch-ae
@@ -0,0 +1,13 @@
+$NetBSD: patch-ae,v 1.1 2004/11/11 10:19:29 martin Exp $
+
+--- dump2300.c.orig 2004-04-23 17:36:24.000000000 +0200
++++ dump2300.c 2004-11-10 23:53:23.000000000 +0100
+@@ -110,7 +110,7 @@
+ }
+
+ // Read the data. If expected number of bytes read break out of loop.
+- if (read_data(ws2300, address, bytes, data, command)==bytes)
++ if (read_data(ws2300, address, bytes, data, command, 1)==bytes)
+ {
+ break;
+ }
diff --git a/misc/open2300/patches/patch-af b/misc/open2300/patches/patch-af
new file mode 100644
index 00000000000..fac74478210
--- /dev/null
+++ b/misc/open2300/patches/patch-af
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1 2004/11/11 10:19:29 martin Exp $
+
+--- history2300.c.orig 2004-04-23 17:36:58.000000000 +0200
++++ history2300.c 2004-11-10 23:54:22.000000000 +0100
+@@ -102,7 +102,7 @@
+
+
+ // Read the data. If expected number of bytes read break out of loop.
+- if (read_data(ws2300, address, bytes, data, command)==bytes)
++ if (read_data(ws2300, address, bytes, data, command, 1)==bytes)
+ {
+ break;
+ }
diff --git a/misc/open2300/patches/patch-ag b/misc/open2300/patches/patch-ag
new file mode 100644
index 00000000000..586b9ec346f
--- /dev/null
+++ b/misc/open2300/patches/patch-ag
@@ -0,0 +1,13 @@
+$NetBSD: patch-ag,v 1.1 2004/11/11 10:19:29 martin Exp $
+
+--- bin2300.c.orig 2004-04-23 17:36:10.000000000 +0200
++++ bin2300.c 2004-11-10 23:55:08.000000000 +0100
+@@ -109,7 +109,7 @@
+ }
+
+ // Read the data. If expected number of bytes read break out of loop.
+- if (read_data(ws2300, address, bytes, data, command)==bytes)
++ if (read_data(ws2300, address, bytes, data, command, 1)==bytes)
+ {
+ break;
+ }
diff --git a/misc/open2300/patches/patch-ah b/misc/open2300/patches/patch-ah
new file mode 100644
index 00000000000..2b3b60c9780
--- /dev/null
+++ b/misc/open2300/patches/patch-ah
@@ -0,0 +1,13 @@
+$NetBSD: patch-ah,v 1.1 2004/11/11 10:19:30 martin Exp $
+
+--- open2300.c.orig 2004-04-23 17:36:58.000000000 +0200
++++ open2300.c 2004-11-10 23:57:57.000000000 +0100
+@@ -190,7 +190,7 @@
+ reset_06(ws2300);
+
+ // Read the data. If expected number of bytes read break out of loop.
+- if (read_data(ws2300, address, bytes, data, command)==bytes)
++ if (read_data(ws2300, address, bytes, data, command, 1)==bytes)
+ {
+ break;
+ }