changeset 221:f5ad25edc077

Write commit messages
author Louis Opter <kalessin@kalessin.fr>
date Thu, 06 Aug 2015 02:55:57 -0700
parents f90c0783f654
children 446279fc556a
files add_command_pipe.patch add_daemon_module.patch add_tag_and_untag.patch fix_crash_in_get_light_state_when_tag_does_not_exist.patch fix_lifx_wire_float_endian_functions_naming.patch fix_set_power_state.patch fix_usage_and_version.patch ignore_duplicate_listening_address.patch ignore_pcaps.patch relax_timings.patch update_readme.patch
diffstat 11 files changed, 91 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/add_command_pipe.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/add_command_pipe.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,9 @@
 # HG changeset patch
-# Parent  f937c717c75e9a3e60a327d5b641ada7a4589a07
+# Parent  1bf59939e3a0b2c9ab7c201ae836662322cd9fb8
+Add support for a write-only command pipe for easy scripting
+
+You can just dump simple JSON-RPC calls in it, it will pair nicely with
+the toggle command that I'm gonna implement.
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 --- a/CMakeLists.txt
--- a/add_daemon_module.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/add_daemon_module.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,6 @@
 # HG changeset patch
-# Parent  cbddb13a7d39708480843e537aa02af758d220dd
+# Parent  fa84fd51301cf3bf3786f7e3c03031488f31d1ef
+Actual support for daemonization with a nice process name
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 --- a/CMakeLists.txt
@@ -952,7 +953,7 @@
  )
 -TARGET_LINK_LIBRARIES(test_core_proto ${TIME_MONOTONIC_LIBRARY})
  
- FUNCTION(ADD_ROUTER_TEST TEST_SOURCE)
+ FUNCTION(ADD_PROTO_TEST TEST_SOURCE)
      ADD_TEST_FROM_C_SOURCES(${TEST_SOURCE} test_core_proto)
 diff --git a/tests/core/proto/test_proto_get_light_state.c b/tests/core/proto/test_proto_get_light_state.c
 --- a/tests/core/proto/test_proto_get_light_state.c
--- a/add_tag_and_untag.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/add_tag_and_untag.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,9 @@
 # HG changeset patch
-# Parent  d31deced4d0b4228c4215069ee40febb19b71c15
+# Parent  a4ff67d866644b2bf11abb7030d1f4ce8c6b0988
+Add initial support for tag (grouping) and untag (ungrouping)
+
+It's a bit rough without an auto-retry mechanism and it doesn't seem to work
+well with the newer bulbs like the LIFX White 800.
 
 diff --git a/README.rst b/README.rst
 --- a/README.rst
--- a/fix_crash_in_get_light_state_when_tag_does_not_exist.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/fix_crash_in_get_light_state_when_tag_does_not_exist.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,9 @@
 # HG changeset patch
-# Parent  b6ac01b32ad7a6c3ec5b7b3c45490eb9f47c0951
+# Parent  7b0e8adfc825726be69cea48e7cf3883dbbe7d12
+Handle bulbs with bugged tags bitfields
+
+I'm getting that on the LIFX White 800 for tag and untag I'm afraid
+something is weird with their firmare.
 
 diff --git a/core/proto.c b/core/proto.c
 --- a/core/proto.c
--- a/fix_lifx_wire_float_endian_functions_naming.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/fix_lifx_wire_float_endian_functions_naming.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,6 @@
 # HG changeset patch
-# Parent  80fb374d7109e03c44f049a2d7a845abf00663e1
+# Parent  493a81b724f08c6d746c3879bafd86e7f05342fa
+Fix a couple function names
 
 diff --git a/lifx/wire_proto.c b/lifx/wire_proto.c
 --- a/lifx/wire_proto.c
@@ -36,7 +37,7 @@
 diff --git a/tests/core/proto/test_proto_set_waveform.c b/tests/core/proto/test_proto_set_waveform.c
 --- a/tests/core/proto/test_proto_set_waveform.c
 +++ b/tests/core/proto/test_proto_set_waveform.c
-@@ -37,7 +37,7 @@
+@@ -36,7 +36,7 @@
      int brightness = le16toh(waveform->brightness);
      int kelvin = le16toh(waveform->kelvin);
      int period = le32toh(waveform->period);
@@ -48,7 +49,7 @@
 diff --git a/tests/core/proto/test_proto_set_waveform_on_routing_error.c b/tests/core/proto/test_proto_set_waveform_on_routing_error.c
 --- a/tests/core/proto/test_proto_set_waveform_on_routing_error.c
 +++ b/tests/core/proto/test_proto_set_waveform_on_routing_error.c
-@@ -37,7 +37,7 @@
+@@ -36,7 +36,7 @@
      int brightness = le16toh(waveform->brightness);
      int kelvin = le16toh(waveform->kelvin);
      int period = le32toh(waveform->period);
--- a/fix_set_power_state.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/fix_set_power_state.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,10 +1,13 @@
 # HG changeset patch
-# Parent  46aa876b47a3e3c07b4855aa4cbff94acba75e16
+# Parent  b5f496df71441bfe4bb153a027acf832255ea81a
+Handle intermediate values between POWER_STATE_ON and OFF from the bulbs
+
+It's supposed to be 0xffff or 0 but that's actually not true.
 
 diff --git a/lifx/wire_proto.c b/lifx/wire_proto.c
 --- a/lifx/wire_proto.c
 +++ b/lifx/wire_proto.c
-@@ -341,16 +341,22 @@
+@@ -342,16 +342,22 @@
      pkt->brightness = le16toh(pkt->brightness);
      pkt->kelvin = le16toh(pkt->kelvin);
      pkt->dim = le16toh(pkt->dim);
--- a/fix_usage_and_version.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/fix_usage_and_version.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,10 +1,11 @@
 # HG changeset patch
-# Parent  298fe56d98508afd0b2d3098264f4661d5908fe5
+# Parent  0a70598874618551b57f92c9f8fb83769a04487f
+UI/Cosmetic fixes
 
 diff --git a/core/lightsd.c b/core/lightsd.c
 --- a/core/lightsd.c
 +++ b/core/lightsd.c
-@@ -138,6 +138,7 @@
+@@ -139,6 +139,7 @@
          "  [-v,--verbosity debug|info|warning|error]\n",
          progname
      );
@@ -12,7 +13,7 @@
      exit(0);
  }
  
-@@ -159,6 +160,10 @@
+@@ -162,6 +163,10 @@
      };
      const char short_opts[] = "l:c:fthv:V";
  
@@ -23,6 +24,15 @@
      for (int rv = getopt_long(argc, argv, short_opts, long_opts, NULL);
           rv != -1;
           rv = getopt_long(argc, argv, short_opts, long_opts, NULL)) {
+@@ -205,7 +210,7 @@
+             }
+             break;
+         case 'V':
+-            printf("%s v%s\n", argv[0], LGTD_VERSION);
++            printf("lightsd v%s\n", LGTD_VERSION);
+             return 0;
+         default:
+             lgtd_usage(argv[0]);
 diff --git a/core/version.h.in b/core/version.h.in
 --- a/core/version.h.in
 +++ b/core/version.h.in
@@ -32,6 +42,6 @@
  
 -const char LGTD_VERSION[] = "@LGTD_VERSION@";
 +const char LGTD_VERSION[] = (
-+    "@LIGHTSD_VERSION@"
-+    "\n\nCopyright (c) 2014, 2015, Louis Opter <kalessin@kalessin.fr>"
++    "@LIGHTSD_VERSION@\n\n"
++    "Copyright (c) 2014, 2015, Louis Opter <kalessin@kalessin.fr>"
 +);
--- a/ignore_duplicate_listening_address.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/ignore_duplicate_listening_address.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,6 @@
 # HG changeset patch
 # Parent  d8e34f128c677442c5c047793207dbc1664b6c2e
+Allow duplicate listening address in the command line
 
 diff --git a/core/listen.c b/core/listen.c
 --- a/core/listen.c
--- a/ignore_pcaps.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/ignore_pcaps.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,9 @@
 # HG changeset patch
-# Parent  d7f8706407ee3520ecd1c964be8df4a2aebd5d12
+# Parent  a0c1768fb594da51951048f6b167ab5a9499d734
+Ignore my packet captures directories
+
+I never found myself looking for an older pcap, what we really need is a bulb
+simulator and test scenarios.
 
 diff --git a/.hgignore b/.hgignore
 --- a/.hgignore
--- a/relax_timings.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/relax_timings.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,5 +1,6 @@
 # HG changeset patch
-# Parent  53fb61e971ca76d1222c16512bd7fe7defc79844
+# Parent  fbfdbecbaa8d13e475e4851ccda9065c6369c437
+Relax different timings a bit (until we get auto-retry on everything)
 
 diff --git a/lifx/gateway.h b/lifx/gateway.h
 --- a/lifx/gateway.h
@@ -9,7 +10,7 @@
  // consumption at all (and it's interesting to note that a turned off bulb
  // still draw about 2W in ZigBee and about 3W in WiFi).
 -enum { LGTD_LIFX_GATEWAY_MIN_REFRESH_INTERVAL_MSECS = 200 };
-+enum { LGTD_LIFX_GATEWAY_MIN_REFRESH_INTERVAL_MSECS = 1000 };
++enum { LGTD_LIFX_GATEWAY_MIN_REFRESH_INTERVAL_MSECS = 800 };
  
  // You can't send more than one lifx packet per UDP datagram.
  enum { LGTD_LIFX_GATEWAY_PACKET_RING_SIZE = 16 };
@@ -26,7 +27,7 @@
  enum { LGTD_LIFX_TIMER_PASSIVE_DISCOVERY_INTERVAL_MSECS = 10000 };
 -enum { LGTD_LIFX_TIMER_DEVICE_TIMEOUT_MSECS = 2000 };
 -enum { LGTD_LIFX_TIMER_DEVICE_FORCE_REFRESH_MSECS = 600 };
-+enum { LGTD_LIFX_TIMER_DEVICE_TIMEOUT_MSECS = 4000 };
++enum { LGTD_LIFX_TIMER_DEVICE_TIMEOUT_MSECS = 3000 };
 +enum { LGTD_LIFX_TIMER_DEVICE_FORCE_REFRESH_MSECS = 2000 };
  
  bool lgtd_lifx_timer_setup(void);
--- a/update_readme.patch	Wed Aug 05 00:52:01 2015 -0700
+++ b/update_readme.patch	Thu Aug 06 02:55:57 2015 -0700
@@ -1,10 +1,43 @@
 # HG changeset patch
-# Parent  04a46ad71a58fa6486754a8e97da9f06436d5a01
+# Parent  a660cf68b39b944f49e40116ea2668631c399cda
+Reword the README a bit
 
 diff --git a/README.rst b/README.rst
 --- a/README.rst
 +++ b/README.rst
-@@ -103,4 +103,22 @@
+@@ -10,8 +10,8 @@
+ 
+ - no discovery delay ever, you get all the bulbs and their state right away;
+ - lightsd is always in sync with the bulbs and always know their state;
+-- lightsd act as an abstraction layer and can expose new discovery mechanism and
+-  totally new APIs;
++- lightsd act as an abstraction layer and can expose new discovery mechanisms and
++  an unified API across different kind of smart bulbs;
+ - For those of you with a high paranoia factor, lightsd let you place your bulbs
+   in a totally separate and closed network.
+ 
+@@ -24,8 +24,8 @@
+ lightsd discovers your LIFX bulbs, stays in sync with them and support the
+ following commands through a JSON-RPC_ interface:
+ 
+-- power_off;
+-- power_on;
++- power_off (with auto-retry);
++- power_on (with auto-retry);
+ - set_light_from_hsbk;
+ - set_waveform (change the light according to a function like SAW or SINE);
+ - get_light_state;
+@@ -68,7 +68,8 @@
+ ``setproctitle`` (pretty much any non-BSD system, including Mac OS X).
+ 
+ lightsd is actively developed and tested from Arch Linux, Debian and Mac OS X;
+-both for 32/64 bits and little/big endian architectures.
++both for 32/64 bits, little endian with big endian (mips32) support being worked
++on.
+ 
+ Build instructions
+ ------------------
+@@ -103,4 +104,22 @@
  
  Use the ``-f`` option to run lightsd in the foreground.
  
@@ -17,12 +50,12 @@
 +
 +Power ON/OFF are the only commands with auto-retry, i.e: lightsd will keep
 +sending the command to the bulb until its state changes. This is not implemented
-+(yet) for ``set_light_from_hsbk`` and ``set_waveform``.
++(yet) for ``set_light_from_hsbk``, ``set_waveform``, ``tag`` and ``untag``.
 +
 +While lighsd appears to be pretty stable, if you want to run lightsd in the
-+background, I recommend doing it in a processor supervisor (e.g: Supervisor_)
-+that can restart lightsd in case of crash. Otherwise, please send me your crash
-+reports!
++background, I recommend doing so in a processor supervisor (e.g: Supervisor_)
++that can restart lightsd if it crashes. Otherwise, please feel free to report
++crashes to me.
 +
 +.. _Supervisor: http://www.supervisord.org/
 +