changeset 8:cf915ece9e48

Remove "week day" from the TIME response The week day item in the TIME response is useless. Drivewire 4 doesn't return it and since that is the most common Drivewire implementation, it makes sense to conform to that definition.
author William Astle <lost@l-w.ca>
date Sat, 16 Jul 2016 18:56:01 -0600
parents 2e382e1a173e
children a11b330771e0
files docs/protocol.txt src/lwwire.c
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/docs/protocol.txt	Sat Jun 11 12:26:39 2016 -0600
+++ b/docs/protocol.txt	Sat Jul 16 18:56:01 2016 -0600
@@ -119,14 +119,19 @@
  3	hour (0-23)
  4	minute (0-59)
  5	second (0-60)
- 6	day of week (0-6, 0 = Sunday)
 
 This packet roughly corresponds to the return structure for the localtime()
 function in C. Note that this request is part of the original Drivewire 3
 specification. However, Drivewire 3 specifies only 0-59 for the seconds
 value. LWWire allows the value 60 for the seconds value for the rare case
 where a leap second is in effect. This is unlikely to ever be a problem in
-real deployments since leap seconds can occur at most four times per year.
+real deployments since leap seconds can occur at most twelve times per year.
+
+The original Drivewire 3 ipmlementation returned a seventh octet which
+encoded the day of the week with Sunday as 0. Since the most common
+Drivewire implementation is the Drivewire 4 server which only sends the six
+octets and the day of the week value is basically useless, this
+specification conforms to the Drivewire 4 implementation.
 
 
 46 PRINTFLUSH
--- a/src/lwwire.c	Sat Jun 11 12:26:39 2016 -0600
+++ b/src/lwwire.c	Sat Jul 16 18:56:01 2016 -0600
@@ -174,8 +174,7 @@
 			buf[3] = tmval -> tm_hour;
 			buf[4] = tmval -> tm_min;
 			buf[5] = tmval -> tm_sec;
-			buf[6] = tmval -> tm_wday;
-			lwwire_write(buf, 7);
+			lwwire_write(buf, 6);
 			break;
 		
 		case 0x46: // PRINTFLUSH