[Info] LightManager Pro mit Linux bedienen

zwiebelchen

Neuer User
Mitglied seit
31 Mai 2009
Beiträge
13
Punkte für Reaktionen
0
Punkte
0
Hi,

ich habe mich mal ran gesetzt und versucht, den LightManager Pro über Linux zu steuern (mit dem Ziel, ihn mal an die Fritz!Box zu hängen).

Aktueller Status:
Ich habe ein Programm geschrieben, was am Port 3456 auf eingehende Verbindungen wartet und Kommandos wie "A1_ON" oder "C3_OFF" akzeptiert. Dies Funktioniert zumindest an meinem Debian Wheezy X64 PC sehr gut. Momentan habe ich aber nur Intertechno Devices drin, aber FS20 wird mit der Zeit auch kommen (ich weiß, wie ich es mache, es mangelt nur etwas an Zeit).

Jetzt meine Bitte:

Könnte jemand das ganze mal für Freetz kompilieren und testen ?

Hier die Projekt-Seite:
https://code.google.com/p/light-manager-c/

Freue mich auf reichlich Lob / Kritik / Rückmeldungen :)
 
Könnte jemand das ganze mal für Freetz kompilieren und testen ?
Kompilieren geht (siehe Paket als Patch), testen können andere ;-), weil ich z. Zt. keine libusb-1.0 auf meiner Box habe. Wegen mobil-style, kein Anhang möglich. Der Patch aus dem code-Block muss nach einem copy&paste evtl. neu formatiert werden:
Code:
diff -Naur '--exclude=.*' make/lightmanager.orig/Config.in make/lightmanager/Config.in
--- make/lightmanager.orig/Config.in	1970-01-01 01:00:00.000000000 +0100
+++ make/lightmanager/Config.in	2012-07-03 14:53:45.000000000 +0200
@@ -0,0 +1,10 @@
+config FREETZ_PACKAGE_LIGHTMANAGER
+	bool "lightmanager 0.1 (binary only)"
+	select FREETZ_LIB_libusb_1
+	default n
+	help
+		It's a little linux server program which allows you to control
+		your jbmedia LightManager connected via USB. The program uses
+		LibUSB 1.0 and a few standart Linux network headers. 
+		IPPF: http://www.ip-phone-forum.de/showthread.php?t=249984
+		WWW: https://code.google.com/p/light-manager-c/
diff -Naur '--exclude=.*' make/lightmanager.orig/lightmanager.mk make/lightmanager/lightmanager.mk
--- make/lightmanager.orig/lightmanager.mk	1970-01-01 01:00:00.000000000 +0100
+++ make/lightmanager/lightmanager.mk	2012-07-03 15:04:20.000000000 +0200
@@ -0,0 +1,27 @@
+$(call PKG_INIT_BIN, 0.1)
+$(PKG)_BINARY:=$($(PKG)_DIR)/$(pkg)
+$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/bin/$(pkg)
+
+$(PKG)_DEPENDS_ON :=libusb1
+
+$(PKG_LOCALSOURCE_PACKAGE)
+$(PKG_CONFIGURED_NOP)
+
+$($(PKG)_BINARY): $($(PKG)_DIR)/.configured
+	$(SUBMAKE) -C $(LIGHTMANAGER_DIR) \
+		CC="$(TARGET_CC)" \
+		CFLAGS="$(TARGET_CFLAGS)"
+
+$($(PKG)_TARGET_BINARY): $($(PKG)_BINARY)
+	$(INSTALL_BINARY_STRIP)
+
+$(pkg)-precompiled: $($(PKG)_TARGET_BINARY)
+
+$(pkg)-clean:
+	-$(SUBMAKE) -C $(LIGHTMANAGER_DIR) clean
+	 $(RM) $(LIGHTMANAGER_DIR)/.configured
+
+$(pkg)-uninstall:
+	$(RM) $(LIGHTMANAGER_TARGET_BINARY)
+
+$(PKG_FINISH)
diff -Naur '--exclude=.*' make/lightmanager.orig/src/actors.h make/lightmanager/src/actors.h
--- make/lightmanager.orig/src/actors.h	1970-01-01 01:00:00.000000000 +0100
+++ make/lightmanager/src/actors.h	2012-07-03 13:22:52.000000000 +0200
@@ -0,0 +1,560 @@
+/*
+ * actors.h
+ *
+ * Contains code to be send to LightManager
+ *
+ *  Created on: 02.07.2012
+ *      Author: zwiebelchen
+ */
+
+#ifndef ACTORS_H_
+#define ACTORS_H_
+
+// Intertechno devices
+
+unsigned char A1_ON[] = { 0x05, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A2_ON[] = { 0x05, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A3_ON[] = { 0x05, 0x02, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A4_ON[] = { 0x05, 0x03, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A5_ON[] = { 0x05, 0x04, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A6_ON[] = { 0x05, 0x05, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A7_ON[] = { 0x05, 0x06, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A8_ON[] = { 0x05, 0x07, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A9_ON[] = { 0x05, 0x08, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A10_ON[] = { 0x05, 0x09, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A11_ON[] = { 0x05, 0x0a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A12_ON[] = { 0x05, 0x0b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A13_ON[] = { 0x05, 0x0c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A14_ON[] = { 0x05, 0x0d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A15_ON[] = { 0x05, 0x0e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A16_ON[] = { 0x05, 0x0f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char A1_OFF[] = { 0x05, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A2_OFF[] = { 0x05, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A3_OFF[] = { 0x05, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A4_OFF[] = { 0x05, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A5_OFF[] = { 0x05, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A6_OFF[] = { 0x05, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A7_OFF[] = { 0x05, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A8_OFF[] = { 0x05, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A9_OFF[] = { 0x05, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A10_OFF[] = { 0x05, 0x09, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A11_OFF[] = { 0x05, 0x0a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A12_OFF[] = { 0x05, 0x0b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A13_OFF[] = { 0x05, 0x0c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A14_OFF[] = { 0x05, 0x0d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A15_OFF[] = { 0x05, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char A16_OFF[] = { 0x05, 0x0f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char B1_ON[] = { 0x05, 0x10, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B2_ON[] = { 0x05, 0x11, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B3_ON[] = { 0x05, 0x12, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B4_ON[] = { 0x05, 0x13, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B5_ON[] = { 0x05, 0x14, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B6_ON[] = { 0x05, 0x15, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B7_ON[] = { 0x05, 0x16, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B8_ON[] = { 0x05, 0x17, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B9_ON[] = { 0x05, 0x18, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B10_ON[] = { 0x05, 0x19, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B11_ON[] = { 0x05, 0x1a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B12_ON[] = { 0x05, 0x1b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B13_ON[] = { 0x05, 0x1c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B14_ON[] = { 0x05, 0x1d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B15_ON[] = { 0x05, 0x1e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B16_ON[] = { 0x05, 0x1f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char B1_OFF[] = { 0x05, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B2_OFF[] = { 0x05, 0x11, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B3_OFF[] = { 0x05, 0x12, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B4_OFF[] = { 0x05, 0x13, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B5_OFF[] = { 0x05, 0x14, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B6_OFF[] = { 0x05, 0x15, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B7_OFF[] = { 0x05, 0x16, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B8_OFF[] = { 0x05, 0x17, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B9_OFF[] = { 0x05, 0x18, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B10_OFF[] = { 0x05, 0x19, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B11_OFF[] = { 0x05, 0x1a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B12_OFF[] = { 0x05, 0x1b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B13_OFF[] = { 0x05, 0x1c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B14_OFF[] = { 0x05, 0x1d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B15_OFF[] = { 0x05, 0x1e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char B16_OFF[] = { 0x05, 0x1f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char C1_ON[] = { 0x05, 0x20, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C2_ON[] = { 0x05, 0x21, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C3_ON[] = { 0x05, 0x22, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C4_ON[] = { 0x05, 0x23, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C5_ON[] = { 0x05, 0x24, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C6_ON[] = { 0x05, 0x25, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C7_ON[] = { 0x05, 0x26, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C8_ON[] = { 0x05, 0x27, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C9_ON[] = { 0x05, 0x28, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C10_ON[] = { 0x05, 0x29, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C11_ON[] = { 0x05, 0x2a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C12_ON[] = { 0x05, 0x2b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C13_ON[] = { 0x05, 0x2c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C14_ON[] = { 0x05, 0x2d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C15_ON[] = { 0x05, 0x2e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C16_ON[] = { 0x05, 0x2f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char C1_OFF[] = { 0x05, 0x20, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C2_OFF[] = { 0x05, 0x21, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C3_OFF[] = { 0x05, 0x22, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C4_OFF[] = { 0x05, 0x23, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C5_OFF[] = { 0x05, 0x24, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C6_OFF[] = { 0x05, 0x25, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C7_OFF[] = { 0x05, 0x26, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C8_OFF[] = { 0x05, 0x27, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C9_OFF[] = { 0x05, 0x28, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C10_OFF[] = { 0x05, 0x29, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C11_OFF[] = { 0x05, 0x2a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C12_OFF[] = { 0x05, 0x2b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C13_OFF[] = { 0x05, 0x2c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C14_OFF[] = { 0x05, 0x2d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C15_OFF[] = { 0x05, 0x2e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char C16_OFF[] = { 0x05, 0x2f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char D1_ON[] = { 0x05, 0x30, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D2_ON[] = { 0x05, 0x31, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D3_ON[] = { 0x05, 0x32, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D4_ON[] = { 0x05, 0x33, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D5_ON[] = { 0x05, 0x34, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D6_ON[] = { 0x05, 0x35, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D7_ON[] = { 0x05, 0x36, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D8_ON[] = { 0x05, 0x37, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D9_ON[] = { 0x05, 0x38, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D10_ON[] = { 0x05, 0x39, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D11_ON[] = { 0x05, 0x3a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D12_ON[] = { 0x05, 0x3b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D13_ON[] = { 0x05, 0x3c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D14_ON[] = { 0x05, 0x3d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D15_ON[] = { 0x05, 0x3e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D16_ON[] = { 0x05, 0x3f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char D1_OFF[] = { 0x05, 0x30, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D2_OFF[] = { 0x05, 0x31, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D3_OFF[] = { 0x05, 0x32, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D4_OFF[] = { 0x05, 0x33, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D5_OFF[] = { 0x05, 0x34, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D6_OFF[] = { 0x05, 0x35, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D7_OFF[] = { 0x05, 0x36, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D8_OFF[] = { 0x05, 0x37, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D9_OFF[] = { 0x05, 0x38, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D10_OFF[] = { 0x05, 0x39, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D11_OFF[] = { 0x05, 0x3a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D12_OFF[] = { 0x05, 0x3b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D13_OFF[] = { 0x05, 0x3c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D14_OFF[] = { 0x05, 0x3d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D15_OFF[] = { 0x05, 0x3e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char D16_OFF[] = { 0x05, 0x3f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char E1_ON[] = { 0x05, 0x40, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E2_ON[] = { 0x05, 0x41, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E3_ON[] = { 0x05, 0x42, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E4_ON[] = { 0x05, 0x43, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E5_ON[] = { 0x05, 0x44, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E6_ON[] = { 0x05, 0x45, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E7_ON[] = { 0x05, 0x46, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E8_ON[] = { 0x05, 0x47, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E9_ON[] = { 0x05, 0x48, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E10_ON[] = { 0x05, 0x49, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E11_ON[] = { 0x05, 0x4a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E12_ON[] = { 0x05, 0x4b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E13_ON[] = { 0x05, 0x4c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E14_ON[] = { 0x05, 0x4d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E15_ON[] = { 0x05, 0x4e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E16_ON[] = { 0x05, 0x4f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char E1_OFF[] = { 0x05, 0x40, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E2_OFF[] = { 0x05, 0x41, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E3_OFF[] = { 0x05, 0x42, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E4_OFF[] = { 0x05, 0x43, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E5_OFF[] = { 0x05, 0x44, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E6_OFF[] = { 0x05, 0x45, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E7_OFF[] = { 0x05, 0x46, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E8_OFF[] = { 0x05, 0x47, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E9_OFF[] = { 0x05, 0x48, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E10_OFF[] = { 0x05, 0x49, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E11_OFF[] = { 0x05, 0x4a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E12_OFF[] = { 0x05, 0x4b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E13_OFF[] = { 0x05, 0x4c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E14_OFF[] = { 0x05, 0x4d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E15_OFF[] = { 0x05, 0x4e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char E16_OFF[] = { 0x05, 0x4f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char F1_ON[] = { 0x05, 0x50, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F2_ON[] = { 0x05, 0x51, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F3_ON[] = { 0x05, 0x52, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F4_ON[] = { 0x05, 0x53, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F5_ON[] = { 0x05, 0x54, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F6_ON[] = { 0x05, 0x55, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F7_ON[] = { 0x05, 0x56, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F8_ON[] = { 0x05, 0x57, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F9_ON[] = { 0x05, 0x58, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F10_ON[] = { 0x05, 0x59, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F11_ON[] = { 0x05, 0x5a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F12_ON[] = { 0x05, 0x5b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F13_ON[] = { 0x05, 0x5c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F14_ON[] = { 0x05, 0x5d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F15_ON[] = { 0x05, 0x5e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F16_ON[] = { 0x05, 0x5f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char F1_OFF[] = { 0x05, 0x50, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F2_OFF[] = { 0x05, 0x51, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F3_OFF[] = { 0x05, 0x52, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F4_OFF[] = { 0x05, 0x53, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F5_OFF[] = { 0x05, 0x54, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F6_OFF[] = { 0x05, 0x55, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F7_OFF[] = { 0x05, 0x56, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F8_OFF[] = { 0x05, 0x57, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F9_OFF[] = { 0x05, 0x58, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F10_OFF[] = { 0x05, 0x59, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F11_OFF[] = { 0x05, 0x5a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F12_OFF[] = { 0x05, 0x5b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F13_OFF[] = { 0x05, 0x5c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F14_OFF[] = { 0x05, 0x5d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F15_OFF[] = { 0x05, 0x5e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char F16_OFF[] = { 0x05, 0x5f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+
+unsigned char G1_ON[] = { 0x05, 0x60, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G2_ON[] = { 0x05, 0x61, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G3_ON[] = { 0x05, 0x62, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G4_ON[] = { 0x05, 0x63, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G5_ON[] = { 0x05, 0x64, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G6_ON[] = { 0x05, 0x65, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G7_ON[] = { 0x05, 0x66, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G8_ON[] = { 0x05, 0x67, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G9_ON[] = { 0x05, 0x68, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G10_ON[] = { 0x05, 0x69, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G11_ON[] = { 0x05, 0x6a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G12_ON[] = { 0x05, 0x6b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G13_ON[] = { 0x05, 0x6c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G14_ON[] = { 0x05, 0x6d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G15_ON[] = { 0x05, 0x6e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G16_ON[] = { 0x05, 0x6f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char G1_OFF[] = { 0x05, 0x60, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G2_OFF[] = { 0x05, 0x61, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G3_OFF[] = { 0x05, 0x62, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G4_OFF[] = { 0x05, 0x63, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G5_OFF[] = { 0x05, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G6_OFF[] = { 0x05, 0x65, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G7_OFF[] = { 0x05, 0x66, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G8_OFF[] = { 0x05, 0x67, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G9_OFF[] = { 0x05, 0x68, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G10_OFF[] = { 0x05, 0x69, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G11_OFF[] = { 0x05, 0x6a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G12_OFF[] = { 0x05, 0x6b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G13_OFF[] = { 0x05, 0x6c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G14_OFF[] = { 0x05, 0x6d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G15_OFF[] = { 0x05, 0x6e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char G16_OFF[] = { 0x05, 0x6f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char H1_ON[] = { 0x05, 0x70, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H2_ON[] = { 0x05, 0x71, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H3_ON[] = { 0x05, 0x72, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H4_ON[] = { 0x05, 0x73, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H5_ON[] = { 0x05, 0x74, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H6_ON[] = { 0x05, 0x75, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H7_ON[] = { 0x05, 0x76, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H8_ON[] = { 0x05, 0x77, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H9_ON[] = { 0x05, 0x78, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H10_ON[] = { 0x05, 0x79, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H11_ON[] = { 0x05, 0x7a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H12_ON[] = { 0x05, 0x7b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H13_ON[] = { 0x05, 0x7c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H14_ON[] = { 0x05, 0x7d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H15_ON[] = { 0x05, 0x7e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H16_ON[] = { 0x05, 0x7f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char H1_OFF[] = { 0x05, 0x70, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H2_OFF[] = { 0x05, 0x71, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H3_OFF[] = { 0x05, 0x72, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H4_OFF[] = { 0x05, 0x73, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H5_OFF[] = { 0x05, 0x74, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H6_OFF[] = { 0x05, 0x75, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H7_OFF[] = { 0x05, 0x76, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H8_OFF[] = { 0x05, 0x77, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H9_OFF[] = { 0x05, 0x78, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H10_OFF[] = { 0x05, 0x79, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H11_OFF[] = { 0x05, 0x7a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H12_OFF[] = { 0x05, 0x7b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H13_OFF[] = { 0x05, 0x7c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H14_OFF[] = { 0x05, 0x7d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H15_OFF[] = { 0x05, 0x7e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char H16_OFF[] = { 0x05, 0x7f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char I1_ON[] = { 0x05, 0x80, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I2_ON[] = { 0x05, 0x81, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I3_ON[] = { 0x05, 0x82, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I4_ON[] = { 0x05, 0x83, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I5_ON[] = { 0x05, 0x84, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I6_ON[] = { 0x05, 0x85, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I7_ON[] = { 0x05, 0x86, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I8_ON[] = { 0x05, 0x87, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I9_ON[] = { 0x05, 0x88, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I10_ON[] = { 0x05, 0x89, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I11_ON[] = { 0x05, 0x8a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I12_ON[] = { 0x05, 0x8b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I13_ON[] = { 0x05, 0x8c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I14_ON[] = { 0x05, 0x8d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I15_ON[] = { 0x05, 0x8e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I16_ON[] = { 0x05, 0x8f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char I1_OFF[] = { 0x05, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I2_OFF[] = { 0x05, 0x81, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I3_OFF[] = { 0x05, 0x82, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I4_OFF[] = { 0x05, 0x83, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I5_OFF[] = { 0x05, 0x84, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I6_OFF[] = { 0x05, 0x85, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I7_OFF[] = { 0x05, 0x86, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I8_OFF[] = { 0x05, 0x87, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I9_OFF[] = { 0x05, 0x88, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I10_OFF[] = { 0x05, 0x89, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I11_OFF[] = { 0x05, 0x8a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I12_OFF[] = { 0x05, 0x8b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I13_OFF[] = { 0x05, 0x8c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I14_OFF[] = { 0x05, 0x8d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I15_OFF[] = { 0x05, 0x8e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char I16_OFF[] = { 0x05, 0x8f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char J1_ON[] = { 0x05, 0x90, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J2_ON[] = { 0x05, 0x91, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J3_ON[] = { 0x05, 0x92, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J4_ON[] = { 0x05, 0x93, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J5_ON[] = { 0x05, 0x94, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J6_ON[] = { 0x05, 0x95, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J7_ON[] = { 0x05, 0x96, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J8_ON[] = { 0x05, 0x97, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J9_ON[] = { 0x05, 0x98, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J10_ON[] = { 0x05, 0x99, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J11_ON[] = { 0x05, 0x9a, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J12_ON[] = { 0x05, 0x9b, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J13_ON[] = { 0x05, 0x9c, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J14_ON[] = { 0x05, 0x9d, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J15_ON[] = { 0x05, 0x9e, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J16_ON[] = { 0x05, 0x9f, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char J1_OFF[] = { 0x05, 0x90, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J2_OFF[] = { 0x05, 0x91, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J3_OFF[] = { 0x05, 0x92, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J4_OFF[] = { 0x05, 0x93, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J5_OFF[] = { 0x05, 0x94, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J6_OFF[] = { 0x05, 0x95, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J7_OFF[] = { 0x05, 0x96, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J8_OFF[] = { 0x05, 0x97, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J9_OFF[] = { 0x05, 0x98, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J10_OFF[] = { 0x05, 0x99, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J11_OFF[] = { 0x05, 0x9a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J12_OFF[] = { 0x05, 0x9b, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J13_OFF[] = { 0x05, 0x9c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J14_OFF[] = { 0x05, 0x9d, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J15_OFF[] = { 0x05, 0x9e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char J16_OFF[] = { 0x05, 0x9f, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char K1_ON[] = { 0x05, 0xa0, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K2_ON[] = { 0x05, 0xa1, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K3_ON[] = { 0x05, 0xa2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K4_ON[] = { 0x05, 0xa3, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K5_ON[] = { 0x05, 0xa4, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K6_ON[] = { 0x05, 0xa5, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K7_ON[] = { 0x05, 0xa6, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K8_ON[] = { 0x05, 0xa7, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K9_ON[] = { 0x05, 0xa8, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K10_ON[] = { 0x05, 0xa9, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K11_ON[] = { 0x05, 0xaa, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K12_ON[] = { 0x05, 0xab, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K13_ON[] = { 0x05, 0xac, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K14_ON[] = { 0x05, 0xad, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K15_ON[] = { 0x05, 0xae, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K16_ON[] = { 0x05, 0xaf, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char K1_OFF[] = { 0x05, 0xa0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K2_OFF[] = { 0x05, 0xa1, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K3_OFF[] = { 0x05, 0xa2, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K4_OFF[] = { 0x05, 0xa3, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K5_OFF[] = { 0x05, 0xa4, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K6_OFF[] = { 0x05, 0xa5, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K7_OFF[] = { 0x05, 0xa6, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K8_OFF[] = { 0x05, 0xa7, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K9_OFF[] = { 0x05, 0xa8, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K10_OFF[] = { 0x05, 0xa9, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K11_OFF[] = { 0x05, 0xaa, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K12_OFF[] = { 0x05, 0xab, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K13_OFF[] = { 0x05, 0xac, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K14_OFF[] = { 0x05, 0xad, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K15_OFF[] = { 0x05, 0xae, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char K16_OFF[] = { 0x05, 0xaf, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char L1_ON[] = { 0x05, 0xb0, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L2_ON[] = { 0x05, 0xb1, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L3_ON[] = { 0x05, 0xb2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L4_ON[] = { 0x05, 0xb3, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L5_ON[] = { 0x05, 0xb4, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L6_ON[] = { 0x05, 0xb5, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L7_ON[] = { 0x05, 0xb6, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L8_ON[] = { 0x05, 0xb7, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L9_ON[] = { 0x05, 0xb8, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L10_ON[] = { 0x05, 0xb9, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L11_ON[] = { 0x05, 0xba, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L12_ON[] = { 0x05, 0xbb, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L13_ON[] = { 0x05, 0xbc, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L14_ON[] = { 0x05, 0xbd, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L15_ON[] = { 0x05, 0xbe, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L16_ON[] = { 0x05, 0xbf, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char L1_OFF[] = { 0x05, 0xb0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L2_OFF[] = { 0x05, 0xb1, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L3_OFF[] = { 0x05, 0xb2, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L4_OFF[] = { 0x05, 0xb3, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L5_OFF[] = { 0x05, 0xb4, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L6_OFF[] = { 0x05, 0xb5, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L7_OFF[] = { 0x05, 0xb6, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L8_OFF[] = { 0x05, 0xb7, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L9_OFF[] = { 0x05, 0xb8, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L10_OFF[] = { 0x05, 0xb9, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L11_OFF[] = { 0x05, 0xba, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L12_OFF[] = { 0x05, 0xbb, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L13_OFF[] = { 0x05, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L14_OFF[] = { 0x05, 0xbd, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L15_OFF[] = { 0x05, 0xbe, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char L16_OFF[] = { 0x05, 0xbf, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char M1_ON[] = { 0x05, 0xc0, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M2_ON[] = { 0x05, 0xc1, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M3_ON[] = { 0x05, 0xc2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M4_ON[] = { 0x05, 0xc3, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M5_ON[] = { 0x05, 0xc4, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M6_ON[] = { 0x05, 0xc5, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M7_ON[] = { 0x05, 0xc6, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M8_ON[] = { 0x05, 0xc7, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M9_ON[] = { 0x05, 0xc8, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M10_ON[] = { 0x05, 0xc9, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M11_ON[] = { 0x05, 0xca, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M12_ON[] = { 0x05, 0xcb, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M13_ON[] = { 0x05, 0xcc, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M14_ON[] = { 0x05, 0xcd, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M15_ON[] = { 0x05, 0xce, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M16_ON[] = { 0x05, 0xcf, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char M1_OFF[] = { 0x05, 0xc0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M2_OFF[] = { 0x05, 0xc1, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M3_OFF[] = { 0x05, 0xc2, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M4_OFF[] = { 0x05, 0xc3, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M5_OFF[] = { 0x05, 0xc4, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M6_OFF[] = { 0x05, 0xc5, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M7_OFF[] = { 0x05, 0xc6, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M8_OFF[] = { 0x05, 0xc7, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M9_OFF[] = { 0x05, 0xc8, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M10_OFF[] = { 0x05, 0xc9, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M11_OFF[] = { 0x05, 0xca, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M12_OFF[] = { 0x05, 0xcb, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M13_OFF[] = { 0x05, 0xcc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M14_OFF[] = { 0x05, 0xcd, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M15_OFF[] = { 0x05, 0xce, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char M16_OFF[] = { 0x05, 0xcf, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char N1_ON[] = { 0x05, 0xd0, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N2_ON[] = { 0x05, 0xd1, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N3_ON[] = { 0x05, 0xd2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N4_ON[] = { 0x05, 0xd3, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N5_ON[] = { 0x05, 0xd4, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N6_ON[] = { 0x05, 0xd5, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N7_ON[] = { 0x05, 0xd6, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N8_ON[] = { 0x05, 0xd7, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N9_ON[] = { 0x05, 0xd8, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N10_ON[] = { 0x05, 0xd9, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N11_ON[] = { 0x05, 0xda, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N12_ON[] = { 0x05, 0xdb, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N13_ON[] = { 0x05, 0xdc, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N14_ON[] = { 0x05, 0xdd, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N15_ON[] = { 0x05, 0xde, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N16_ON[] = { 0x05, 0xdf, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char N1_OFF[] = { 0x05, 0xd0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N2_OFF[] = { 0x05, 0xd1, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N3_OFF[] = { 0x05, 0xd2, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N4_OFF[] = { 0x05, 0xd3, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N5_OFF[] = { 0x05, 0xd4, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N6_OFF[] = { 0x05, 0xd5, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N7_OFF[] = { 0x05, 0xd6, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N8_OFF[] = { 0x05, 0xd7, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N9_OFF[] = { 0x05, 0xd8, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N10_OFF[] = { 0x05, 0xd9, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N11_OFF[] = { 0x05, 0xda, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N12_OFF[] = { 0x05, 0xdb, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N13_OFF[] = { 0x05, 0xdc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N14_OFF[] = { 0x05, 0xdd, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N15_OFF[] = { 0x05, 0xde, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char N16_OFF[] = { 0x05, 0xdf, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char O1_ON[] = { 0x05, 0xe0, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O2_ON[] = { 0x05, 0xe1, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O3_ON[] = { 0x05, 0xe2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O4_ON[] = { 0x05, 0xe3, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O5_ON[] = { 0x05, 0xe4, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O6_ON[] = { 0x05, 0xe5, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O7_ON[] = { 0x05, 0xe6, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O8_ON[] = { 0x05, 0xe7, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O9_ON[] = { 0x05, 0xe8, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O10_ON[] = { 0x05, 0xe9, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O11_ON[] = { 0x05, 0xea, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O12_ON[] = { 0x05, 0xeb, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O13_ON[] = { 0x05, 0xec, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O14_ON[] = { 0x05, 0xed, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O15_ON[] = { 0x05, 0xee, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O16_ON[] = { 0x05, 0xef, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char O1_OFF[] = { 0x05, 0xe0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O2_OFF[] = { 0x05, 0xe1, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O3_OFF[] = { 0x05, 0xe2, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O4_OFF[] = { 0x05, 0xe3, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O5_OFF[] = { 0x05, 0xe4, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O6_OFF[] = { 0x05, 0xe5, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O7_OFF[] = { 0x05, 0xe6, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O8_OFF[] = { 0x05, 0xe7, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O9_OFF[] = { 0x05, 0xe8, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O10_OFF[] = { 0x05, 0xe9, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O11_OFF[] = { 0x05, 0xea, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O12_OFF[] = { 0x05, 0xeb, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O13_OFF[] = { 0x05, 0xec, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O14_OFF[] = { 0x05, 0xed, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O15_OFF[] = { 0x05, 0xee, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char O16_OFF[] = { 0x05, 0xef, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char P1_ON[] = { 0x05, 0xf0, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P2_ON[] = { 0x05, 0xf1, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P3_ON[] = { 0x05, 0xf2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P4_ON[] = { 0x05, 0xf3, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P5_ON[] = { 0x05, 0xf4, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P6_ON[] = { 0x05, 0xf5, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P7_ON[] = { 0x05, 0xf6, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P8_ON[] = { 0x05, 0xf7, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P9_ON[] = { 0x05, 0xf8, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P10_ON[] = { 0x05, 0xf9, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P11_ON[] = { 0x05, 0xfa, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P12_ON[] = { 0x05, 0xfb, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P13_ON[] = { 0x05, 0xfc, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P14_ON[] = { 0x05, 0xfd, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P15_ON[] = { 0x05, 0xfe, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P16_ON[] = { 0x05, 0xff, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char P1_OFF[] = { 0x05, 0xf0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P2_OFF[] = { 0x05, 0xf1, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P3_OFF[] = { 0x05, 0xf2, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P4_OFF[] = { 0x05, 0xf3, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P5_OFF[] = { 0x05, 0xf4, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P6_OFF[] = { 0x05, 0xf5, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P7_OFF[] = { 0x05, 0xf6, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P8_OFF[] = { 0x05, 0xf7, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P9_OFF[] = { 0x05, 0xf8, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P10_OFF[] = { 0x05, 0xf9, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P11_OFF[] = { 0x05, 0xfa, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P12_OFF[] = { 0x05, 0xfb, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P13_OFF[] = { 0x05, 0xfc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P14_OFF[] = { 0x05, 0xfd, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P15_OFF[] = { 0x05, 0xfe, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+unsigned char P16_OFF[] = { 0x05, 0xff, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
+
+#endif /* ACTORS_H_ */
diff -Naur '--exclude=.*' make/lightmanager.orig/src/lightmanager.c make/lightmanager/src/lightmanager.c
--- make/lightmanager.orig/src/lightmanager.c	1970-01-01 01:00:00.000000000 +0100
+++ make/lightmanager/src/lightmanager.c	2012-07-03 14:59:50.000000000 +0200
@@ -0,0 +1,1145 @@
+/*
+ ============================================================================
+ Name        : LightManagerC.c
+ Author      : zwiebelchen
+ Version     :
+ Copyright   : GPL
+ Description : LightManagerC
+ ============================================================================
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <libusb-1.0/libusb.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <time.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+
+#include "actors.h"
+
+static const int PORT = 3456;
+static const int RECEIVE_BUFFER = 1024;
+
+void sendToUSB(libusb_device_handle* dev_handle, unsigned char* deviceCode) {
+	int actual;
+	libusb_interrupt_transfer(dev_handle, (1 | LIBUSB_ENDPOINT_OUT), deviceCode,
+			8, &actual, 8);
+	libusb_interrupt_transfer(dev_handle, (0x82 | LIBUSB_ENDPOINT_IN),
+			deviceCode, 8, &actual, 8);
+}
+
+int handleInput(char* input, libusb_device_handle* dev_handle) {
+	printf("Handling input...");
+	if (strncmp(input, "A1_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A2_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A3_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A4_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A5_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A6_ON", 5) == 0) {
+		sendToUSB(dev_handle, A6_ON);
+	} else if (strncmp(input, "A7_ON", 5) == 0) {
+		sendToUSB(dev_handle, A7_ON);
+	} else if (strncmp(input, "A8_ON", 5) == 0) {
+		sendToUSB(dev_handle, A8_ON);
+	} else if (strncmp(input, "A9_ON", 5) == 0) {
+		sendToUSB(dev_handle, A9_ON);
+	} else if (strncmp(input, "A10_ON", 6) == 0) {
+		sendToUSB(dev_handle, A10_ON);
+	} else if (strncmp(input, "A11_ON", 6) == 0) {
+		sendToUSB(dev_handle, A11_ON);
+	} else if (strncmp(input, "A12_ON", 6) == 0) {
+		sendToUSB(dev_handle, A12_ON);
+	} else if (strncmp(input, "A13_ON", 6) == 0) {
+		sendToUSB(dev_handle, A13_ON);
+	} else if (strncmp(input, "A14_ON", 6) == 0) {
+		sendToUSB(dev_handle, A14_ON);
+	} else if (strncmp(input, "A15_ON", 6) == 0) {
+		sendToUSB(dev_handle, A15_ON);
+	} else if (strncmp(input, "A16_ON", 6) == 0) {
+		sendToUSB(dev_handle, A16_ON);
+	} else if (strncmp(input, "A1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A1_OFF);
+	} else if (strncmp(input, "A2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A2_OFF);
+	} else if (strncmp(input, "A3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A3_OFF);
+	} else if (strncmp(input, "A4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A4_OFF);
+	} else if (strncmp(input, "A5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A5_OFF);
+	} else if (strncmp(input, "A6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A6_OFF);
+	} else if (strncmp(input, "A7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A7_OFF);
+	} else if (strncmp(input, "A8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A8_OFF);
+	} else if (strncmp(input, "A9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, A9_OFF);
+	} else if (strncmp(input, "A10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, A10_OFF);
+	} else if (strncmp(input, "A11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, A11_OFF);
+	} else if (strncmp(input, "A12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, A12_OFF);
+	} else if (strncmp(input, "A13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, A13_OFF);
+	} else if (strncmp(input, "A14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, A14_OFF);
+	} else if (strncmp(input, "A15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, A15_OFF);
+	} else if (strncmp(input, "A16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, A16_OFF);
+	} else if (strncmp(input, "B1_ON", 5) == 0) {
+		sendToUSB(dev_handle, B1_ON);
+	} else if (strncmp(input, "B2_ON", 5) == 0) {
+		sendToUSB(dev_handle, B2_ON);
+	} else if (strncmp(input, "B3_ON", 5) == 0) {
+		sendToUSB(dev_handle, B3_ON);
+	} else if (strncmp(input, "B4_ON", 5) == 0) {
+		sendToUSB(dev_handle, B4_ON);
+	} else if (strncmp(input, "B5_ON", 5) == 0) {
+		sendToUSB(dev_handle, B5_ON);
+	} else if (strncmp(input, "B6_ON", 5) == 0) {
+		sendToUSB(dev_handle, B6_ON);
+	} else if (strncmp(input, "B7_ON", 5) == 0) {
+		sendToUSB(dev_handle, B7_ON);
+	} else if (strncmp(input, "B8_ON", 5) == 0) {
+		sendToUSB(dev_handle, B8_ON);
+	} else if (strncmp(input, "B9_ON", 5) == 0) {
+		sendToUSB(dev_handle, B9_ON);
+	} else if (strncmp(input, "B10_ON", 6) == 0) {
+		sendToUSB(dev_handle, B10_ON);
+	} else if (strncmp(input, "B11_ON", 6) == 0) {
+		sendToUSB(dev_handle, B11_ON);
+	} else if (strncmp(input, "B12_ON", 6) == 0) {
+		sendToUSB(dev_handle, B12_ON);
+	} else if (strncmp(input, "B13_ON", 6) == 0) {
+		sendToUSB(dev_handle, B13_ON);
+	} else if (strncmp(input, "B14_ON", 6) == 0) {
+		sendToUSB(dev_handle, B14_ON);
+	} else if (strncmp(input, "B15_ON", 6) == 0) {
+		sendToUSB(dev_handle, B15_ON);
+	} else if (strncmp(input, "B16_ON", 6) == 0) {
+		sendToUSB(dev_handle, B16_ON);
+	} else if (strncmp(input, "B1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B1_OFF);
+	} else if (strncmp(input, "B2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B2_OFF);
+	} else if (strncmp(input, "B3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B3_OFF);
+	} else if (strncmp(input, "B4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B4_OFF);
+	} else if (strncmp(input, "B5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B5_OFF);
+	} else if (strncmp(input, "B6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B6_OFF);
+	} else if (strncmp(input, "B7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B7_OFF);
+	} else if (strncmp(input, "B8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B8_OFF);
+	} else if (strncmp(input, "B9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, B9_OFF);
+	} else if (strncmp(input, "B10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, B10_OFF);
+	} else if (strncmp(input, "B11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, B11_OFF);
+	} else if (strncmp(input, "B12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, B12_OFF);
+	} else if (strncmp(input, "B13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, B13_OFF);
+	} else if (strncmp(input, "B14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, B14_OFF);
+	} else if (strncmp(input, "B15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, B15_OFF);
+	} else if (strncmp(input, "B16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, B16_OFF);
+	} else if (strncmp(input, "C1_ON", 5) == 0) {
+		sendToUSB(dev_handle, C1_ON);
+	} else if (strncmp(input, "C2_ON", 5) == 0) {
+		sendToUSB(dev_handle, C2_ON);
+	} else if (strncmp(input, "C3_ON", 5) == 0) {
+		sendToUSB(dev_handle, C3_ON);
+	} else if (strncmp(input, "C4_ON", 5) == 0) {
+		sendToUSB(dev_handle, C4_ON);
+	} else if (strncmp(input, "C5_ON", 5) == 0) {
+		sendToUSB(dev_handle, C5_ON);
+	} else if (strncmp(input, "C6_ON", 5) == 0) {
+		sendToUSB(dev_handle, C6_ON);
+	} else if (strncmp(input, "C7_ON", 5) == 0) {
+		sendToUSB(dev_handle, C7_ON);
+	} else if (strncmp(input, "C8_ON", 5) == 0) {
+		sendToUSB(dev_handle, C8_ON);
+	} else if (strncmp(input, "C9_ON", 5) == 0) {
+		sendToUSB(dev_handle, C9_ON);
+	} else if (strncmp(input, "C10_ON", 6) == 0) {
+		sendToUSB(dev_handle, C10_ON);
+	} else if (strncmp(input, "C11_ON", 6) == 0) {
+		sendToUSB(dev_handle, C11_ON);
+	} else if (strncmp(input, "C12_ON", 6) == 0) {
+		sendToUSB(dev_handle, C12_ON);
+	} else if (strncmp(input, "C13_ON", 6) == 0) {
+		sendToUSB(dev_handle, C13_ON);
+	} else if (strncmp(input, "C14_ON", 6) == 0) {
+		sendToUSB(dev_handle, C14_ON);
+	} else if (strncmp(input, "C15_ON", 6) == 0) {
+		sendToUSB(dev_handle, C15_ON);
+	} else if (strncmp(input, "C16_ON", 6) == 0) {
+		sendToUSB(dev_handle, C16_ON);
+	} else if (strncmp(input, "C1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C1_OFF);
+	} else if (strncmp(input, "C2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C2_OFF);
+	} else if (strncmp(input, "C3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C3_OFF);
+	} else if (strncmp(input, "C4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C4_OFF);
+	} else if (strncmp(input, "C5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C5_OFF);
+	} else if (strncmp(input, "C6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C6_OFF);
+	} else if (strncmp(input, "C7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C7_OFF);
+	} else if (strncmp(input, "C8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C8_OFF);
+	} else if (strncmp(input, "C9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, C9_OFF);
+	} else if (strncmp(input, "C10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, C10_OFF);
+	} else if (strncmp(input, "C11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, C11_OFF);
+	} else if (strncmp(input, "C12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, C12_OFF);
+	} else if (strncmp(input, "C13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, C13_OFF);
+	} else if (strncmp(input, "C14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, C14_OFF);
+	} else if (strncmp(input, "C15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, C15_OFF);
+	} else if (strncmp(input, "C16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, C16_OFF);
+	} else if (strncmp(input, "D1_ON", 5) == 0) {
+		sendToUSB(dev_handle, D1_ON);
+	} else if (strncmp(input, "D2_ON", 5) == 0) {
+		sendToUSB(dev_handle, D2_ON);
+	} else if (strncmp(input, "D3_ON", 5) == 0) {
+		sendToUSB(dev_handle, D3_ON);
+	} else if (strncmp(input, "D4_ON", 5) == 0) {
+		sendToUSB(dev_handle, D4_ON);
+	} else if (strncmp(input, "D5_ON", 5) == 0) {
+		sendToUSB(dev_handle, D5_ON);
+	} else if (strncmp(input, "D6_ON", 5) == 0) {
+		sendToUSB(dev_handle, D6_ON);
+	} else if (strncmp(input, "D7_ON", 5) == 0) {
+		sendToUSB(dev_handle, D7_ON);
+	} else if (strncmp(input, "D8_ON", 5) == 0) {
+		sendToUSB(dev_handle, D8_ON);
+	} else if (strncmp(input, "D9_ON", 5) == 0) {
+		sendToUSB(dev_handle, D9_ON);
+	} else if (strncmp(input, "D10_ON", 6) == 0) {
+		sendToUSB(dev_handle, D10_ON);
+	} else if (strncmp(input, "D11_ON", 6) == 0) {
+		sendToUSB(dev_handle, D11_ON);
+	} else if (strncmp(input, "D12_ON", 6) == 0) {
+		sendToUSB(dev_handle, D12_ON);
+	} else if (strncmp(input, "D13_ON", 6) == 0) {
+		sendToUSB(dev_handle, D13_ON);
+	} else if (strncmp(input, "D14_ON", 6) == 0) {
+		sendToUSB(dev_handle, D14_ON);
+	} else if (strncmp(input, "D15_ON", 6) == 0) {
+		sendToUSB(dev_handle, D15_ON);
+	} else if (strncmp(input, "D16_ON", 6) == 0) {
+		sendToUSB(dev_handle, D16_ON);
+	} else if (strncmp(input, "D1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D1_OFF);
+	} else if (strncmp(input, "D2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D2_OFF);
+	} else if (strncmp(input, "D3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D3_OFF);
+	} else if (strncmp(input, "D4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D4_OFF);
+	} else if (strncmp(input, "D5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D5_OFF);
+	} else if (strncmp(input, "D6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D6_OFF);
+	} else if (strncmp(input, "D7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D7_OFF);
+	} else if (strncmp(input, "D8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D8_OFF);
+	} else if (strncmp(input, "D9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, D9_OFF);
+	} else if (strncmp(input, "D10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, D10_OFF);
+	} else if (strncmp(input, "D11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, D11_OFF);
+	} else if (strncmp(input, "D12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, D12_OFF);
+	} else if (strncmp(input, "D13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, D13_OFF);
+	} else if (strncmp(input, "D14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, D14_OFF);
+	} else if (strncmp(input, "D15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, D15_OFF);
+	} else if (strncmp(input, "D16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, D16_OFF);
+	} else if (strncmp(input, "E1_ON", 5) == 0) {
+		sendToUSB(dev_handle, E1_ON);
+	} else if (strncmp(input, "E2_ON", 5) == 0) {
+		sendToUSB(dev_handle, E2_ON);
+	} else if (strncmp(input, "E3_ON", 5) == 0) {
+		sendToUSB(dev_handle, E3_ON);
+	} else if (strncmp(input, "E4_ON", 5) == 0) {
+		sendToUSB(dev_handle, E4_ON);
+	} else if (strncmp(input, "E5_ON", 5) == 0) {
+		sendToUSB(dev_handle, E5_ON);
+	} else if (strncmp(input, "E6_ON", 5) == 0) {
+		sendToUSB(dev_handle, E6_ON);
+	} else if (strncmp(input, "E7_ON", 5) == 0) {
+		sendToUSB(dev_handle, E7_ON);
+	} else if (strncmp(input, "E8_ON", 5) == 0) {
+		sendToUSB(dev_handle, E8_ON);
+	} else if (strncmp(input, "E9_ON", 5) == 0) {
+		sendToUSB(dev_handle, E9_ON);
+	} else if (strncmp(input, "E10_ON", 6) == 0) {
+		sendToUSB(dev_handle, E10_ON);
+	} else if (strncmp(input, "E11_ON", 6) == 0) {
+		sendToUSB(dev_handle, E11_ON);
+	} else if (strncmp(input, "E12_ON", 6) == 0) {
+		sendToUSB(dev_handle, E12_ON);
+	} else if (strncmp(input, "E13_ON", 6) == 0) {
+		sendToUSB(dev_handle, E13_ON);
+	} else if (strncmp(input, "E14_ON", 6) == 0) {
+		sendToUSB(dev_handle, E14_ON);
+	} else if (strncmp(input, "E15_ON", 6) == 0) {
+		sendToUSB(dev_handle, E15_ON);
+	} else if (strncmp(input, "E16_ON", 6) == 0) {
+		sendToUSB(dev_handle, E16_ON);
+	} else if (strncmp(input, "E1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E1_OFF);
+	} else if (strncmp(input, "E2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E2_OFF);
+	} else if (strncmp(input, "E3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E3_OFF);
+	} else if (strncmp(input, "E4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E4_OFF);
+	} else if (strncmp(input, "E5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E5_OFF);
+	} else if (strncmp(input, "E6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E6_OFF);
+	} else if (strncmp(input, "E7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E7_OFF);
+	} else if (strncmp(input, "E8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E8_OFF);
+	} else if (strncmp(input, "E9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, E9_OFF);
+	} else if (strncmp(input, "E10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, E10_OFF);
+	} else if (strncmp(input, "E11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, E11_OFF);
+	} else if (strncmp(input, "E12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, E12_OFF);
+	} else if (strncmp(input, "E13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, E13_OFF);
+	} else if (strncmp(input, "E14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, E14_OFF);
+	} else if (strncmp(input, "E15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, E15_OFF);
+	} else if (strncmp(input, "E16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, E16_OFF);
+	} else if (strncmp(input, "F1_ON", 5) == 0) {
+		sendToUSB(dev_handle, F1_ON);
+	} else if (strncmp(input, "F2_ON", 5) == 0) {
+		sendToUSB(dev_handle, F2_ON);
+	} else if (strncmp(input, "F3_ON", 5) == 0) {
+		sendToUSB(dev_handle, F3_ON);
+	} else if (strncmp(input, "F4_ON", 5) == 0) {
+		sendToUSB(dev_handle, F4_ON);
+	} else if (strncmp(input, "F5_ON", 5) == 0) {
+		sendToUSB(dev_handle, F5_ON);
+	} else if (strncmp(input, "F6_ON", 5) == 0) {
+		sendToUSB(dev_handle, F6_ON);
+	} else if (strncmp(input, "F7_ON", 5) == 0) {
+		sendToUSB(dev_handle, F7_ON);
+	} else if (strncmp(input, "F8_ON", 5) == 0) {
+		sendToUSB(dev_handle, F8_ON);
+	} else if (strncmp(input, "F9_ON", 5) == 0) {
+		sendToUSB(dev_handle, F9_ON);
+	} else if (strncmp(input, "F10_ON", 6) == 0) {
+		sendToUSB(dev_handle, F10_ON);
+	} else if (strncmp(input, "F11_ON", 6) == 0) {
+		sendToUSB(dev_handle, F11_ON);
+	} else if (strncmp(input, "F12_ON", 6) == 0) {
+		sendToUSB(dev_handle, F12_ON);
+	} else if (strncmp(input, "F13_ON", 6) == 0) {
+		sendToUSB(dev_handle, F13_ON);
+	} else if (strncmp(input, "F14_ON", 6) == 0) {
+		sendToUSB(dev_handle, F14_ON);
+	} else if (strncmp(input, "F15_ON", 6) == 0) {
+		sendToUSB(dev_handle, F15_ON);
+	} else if (strncmp(input, "F16_ON", 6) == 0) {
+		sendToUSB(dev_handle, F16_ON);
+	} else if (strncmp(input, "F1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F1_OFF);
+	} else if (strncmp(input, "F2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F2_OFF);
+	} else if (strncmp(input, "F3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F3_OFF);
+	} else if (strncmp(input, "F4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F4_OFF);
+	} else if (strncmp(input, "F5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F5_OFF);
+	} else if (strncmp(input, "F6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F6_OFF);
+	} else if (strncmp(input, "F7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F7_OFF);
+	} else if (strncmp(input, "F8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F8_OFF);
+	} else if (strncmp(input, "F9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, F9_OFF);
+	} else if (strncmp(input, "F10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, F10_OFF);
+	} else if (strncmp(input, "F11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, F11_OFF);
+	} else if (strncmp(input, "F12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, F12_OFF);
+	} else if (strncmp(input, "F13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, F13_OFF);
+	} else if (strncmp(input, "F14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, F14_OFF);
+	} else if (strncmp(input, "F15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, F15_OFF);
+	} else if (strncmp(input, "F16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, F16_OFF);
+	} else if (strncmp(input, "G1_ON", 5) == 0) {
+		sendToUSB(dev_handle, G1_ON);
+	} else if (strncmp(input, "G2_ON", 5) == 0) {
+		sendToUSB(dev_handle, G2_ON);
+	} else if (strncmp(input, "G3_ON", 5) == 0) {
+		sendToUSB(dev_handle, G3_ON);
+	} else if (strncmp(input, "G4_ON", 5) == 0) {
+		sendToUSB(dev_handle, G4_ON);
+	} else if (strncmp(input, "G5_ON", 5) == 0) {
+		sendToUSB(dev_handle, G5_ON);
+	} else if (strncmp(input, "G6_ON", 5) == 0) {
+		sendToUSB(dev_handle, G6_ON);
+	} else if (strncmp(input, "G7_ON", 5) == 0) {
+		sendToUSB(dev_handle, G7_ON);
+	} else if (strncmp(input, "G8_ON", 5) == 0) {
+		sendToUSB(dev_handle, G8_ON);
+	} else if (strncmp(input, "G9_ON", 5) == 0) {
+		sendToUSB(dev_handle, G9_ON);
+	} else if (strncmp(input, "G10_ON", 6) == 0) {
+		sendToUSB(dev_handle, G10_ON);
+	} else if (strncmp(input, "G11_ON", 6) == 0) {
+		sendToUSB(dev_handle, G11_ON);
+	} else if (strncmp(input, "G12_ON", 6) == 0) {
+		sendToUSB(dev_handle, G12_ON);
+	} else if (strncmp(input, "G13_ON", 6) == 0) {
+		sendToUSB(dev_handle, G13_ON);
+	} else if (strncmp(input, "G14_ON", 6) == 0) {
+		sendToUSB(dev_handle, G14_ON);
+	} else if (strncmp(input, "G15_ON", 6) == 0) {
+		sendToUSB(dev_handle, G15_ON);
+	} else if (strncmp(input, "G16_ON", 6) == 0) {
+		sendToUSB(dev_handle, G16_ON);
+	} else if (strncmp(input, "G1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G1_OFF);
+	} else if (strncmp(input, "G2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G2_OFF);
+	} else if (strncmp(input, "G3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G3_OFF);
+	} else if (strncmp(input, "G4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G4_OFF);
+	} else if (strncmp(input, "G5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G5_OFF);
+	} else if (strncmp(input, "G6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G6_OFF);
+	} else if (strncmp(input, "G7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G7_OFF);
+	} else if (strncmp(input, "G8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G8_OFF);
+	} else if (strncmp(input, "G9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, G9_OFF);
+	} else if (strncmp(input, "G10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, G10_OFF);
+	} else if (strncmp(input, "G11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, G11_OFF);
+	} else if (strncmp(input, "G12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, G12_OFF);
+	} else if (strncmp(input, "G13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, G13_OFF);
+	} else if (strncmp(input, "G14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, G14_OFF);
+	} else if (strncmp(input, "G15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, G15_OFF);
+	} else if (strncmp(input, "G16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, G16_OFF);
+	} else if (strncmp(input, "H1_ON", 5) == 0) {
+		sendToUSB(dev_handle, H1_ON);
+	} else if (strncmp(input, "H2_ON", 5) == 0) {
+		sendToUSB(dev_handle, H2_ON);
+	} else if (strncmp(input, "H3_ON", 5) == 0) {
+		sendToUSB(dev_handle, H3_ON);
+	} else if (strncmp(input, "H4_ON", 5) == 0) {
+		sendToUSB(dev_handle, H4_ON);
+	} else if (strncmp(input, "H5_ON", 5) == 0) {
+		sendToUSB(dev_handle, H5_ON);
+	} else if (strncmp(input, "H6_ON", 5) == 0) {
+		sendToUSB(dev_handle, H6_ON);
+	} else if (strncmp(input, "H7_ON", 5) == 0) {
+		sendToUSB(dev_handle, H7_ON);
+	} else if (strncmp(input, "H8_ON", 5) == 0) {
+		sendToUSB(dev_handle, H8_ON);
+	} else if (strncmp(input, "H9_ON", 5) == 0) {
+		sendToUSB(dev_handle, H9_ON);
+	} else if (strncmp(input, "H10_ON", 6) == 0) {
+		sendToUSB(dev_handle, H10_ON);
+	} else if (strncmp(input, "H11_ON", 6) == 0) {
+		sendToUSB(dev_handle, H11_ON);
+	} else if (strncmp(input, "H12_ON", 6) == 0) {
+		sendToUSB(dev_handle, H12_ON);
+	} else if (strncmp(input, "H13_ON", 6) == 0) {
+		sendToUSB(dev_handle, H13_ON);
+	} else if (strncmp(input, "H14_ON", 6) == 0) {
+		sendToUSB(dev_handle, H14_ON);
+	} else if (strncmp(input, "H15_ON", 6) == 0) {
+		sendToUSB(dev_handle, H15_ON);
+	} else if (strncmp(input, "H16_ON", 6) == 0) {
+		sendToUSB(dev_handle, H16_ON);
+	} else if (strncmp(input, "H1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H1_OFF);
+	} else if (strncmp(input, "H2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H2_OFF);
+	} else if (strncmp(input, "H3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H3_OFF);
+	} else if (strncmp(input, "H4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H4_OFF);
+	} else if (strncmp(input, "H5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H5_OFF);
+	} else if (strncmp(input, "H6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H6_OFF);
+	} else if (strncmp(input, "H7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H7_OFF);
+	} else if (strncmp(input, "H8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H8_OFF);
+	} else if (strncmp(input, "H9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, H9_OFF);
+	} else if (strncmp(input, "H10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, H10_OFF);
+	} else if (strncmp(input, "H11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, H11_OFF);
+	} else if (strncmp(input, "H12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, H12_OFF);
+	} else if (strncmp(input, "H13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, H13_OFF);
+	} else if (strncmp(input, "H14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, H14_OFF);
+	} else if (strncmp(input, "H15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, H15_OFF);
+	} else if (strncmp(input, "H16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, H16_OFF);
+	} else if (strncmp(input, "I1_ON", 5) == 0) {
+		sendToUSB(dev_handle, I1_ON);
+	} else if (strncmp(input, "I2_ON", 5) == 0) {
+		sendToUSB(dev_handle, I2_ON);
+	} else if (strncmp(input, "I3_ON", 5) == 0) {
+		sendToUSB(dev_handle, I3_ON);
+	} else if (strncmp(input, "I4_ON", 5) == 0) {
+		sendToUSB(dev_handle, I4_ON);
+	} else if (strncmp(input, "I5_ON", 5) == 0) {
+		sendToUSB(dev_handle, I5_ON);
+	} else if (strncmp(input, "I6_ON", 5) == 0) {
+		sendToUSB(dev_handle, I6_ON);
+	} else if (strncmp(input, "I7_ON", 5) == 0) {
+		sendToUSB(dev_handle, I7_ON);
+	} else if (strncmp(input, "I8_ON", 5) == 0) {
+		sendToUSB(dev_handle, I8_ON);
+	} else if (strncmp(input, "I9_ON", 5) == 0) {
+		sendToUSB(dev_handle, I9_ON);
+	} else if (strncmp(input, "I10_ON", 6) == 0) {
+		sendToUSB(dev_handle, I10_ON);
+	} else if (strncmp(input, "I11_ON", 6) == 0) {
+		sendToUSB(dev_handle, I11_ON);
+	} else if (strncmp(input, "I12_ON", 6) == 0) {
+		sendToUSB(dev_handle, I12_ON);
+	} else if (strncmp(input, "I13_ON", 6) == 0) {
+		sendToUSB(dev_handle, I13_ON);
+	} else if (strncmp(input, "I14_ON", 6) == 0) {
+		sendToUSB(dev_handle, I14_ON);
+	} else if (strncmp(input, "I15_ON", 6) == 0) {
+		sendToUSB(dev_handle, I15_ON);
+	} else if (strncmp(input, "I16_ON", 6) == 0) {
+		sendToUSB(dev_handle, I16_ON);
+	} else if (strncmp(input, "I1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I1_OFF);
+	} else if (strncmp(input, "I2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I2_OFF);
+	} else if (strncmp(input, "I3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I3_OFF);
+	} else if (strncmp(input, "I4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I4_OFF);
+	} else if (strncmp(input, "I5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I5_OFF);
+	} else if (strncmp(input, "I6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I6_OFF);
+	} else if (strncmp(input, "I7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I7_OFF);
+	} else if (strncmp(input, "I8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I8_OFF);
+	} else if (strncmp(input, "I9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, I9_OFF);
+	} else if (strncmp(input, "I10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, I10_OFF);
+	} else if (strncmp(input, "I11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, I11_OFF);
+	} else if (strncmp(input, "I12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, I12_OFF);
+	} else if (strncmp(input, "I13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, I13_OFF);
+	} else if (strncmp(input, "I14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, I14_OFF);
+	} else if (strncmp(input, "I15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, I15_OFF);
+	} else if (strncmp(input, "I16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, I16_OFF);
+	} else if (strncmp(input, "J1_ON", 5) == 0) {
+		sendToUSB(dev_handle, J1_ON);
+	} else if (strncmp(input, "J2_ON", 5) == 0) {
+		sendToUSB(dev_handle, J2_ON);
+	} else if (strncmp(input, "J3_ON", 5) == 0) {
+		sendToUSB(dev_handle, J3_ON);
+	} else if (strncmp(input, "J4_ON", 5) == 0) {
+		sendToUSB(dev_handle, J4_ON);
+	} else if (strncmp(input, "J5_ON", 5) == 0) {
+		sendToUSB(dev_handle, J5_ON);
+	} else if (strncmp(input, "J6_ON", 5) == 0) {
+		sendToUSB(dev_handle, J6_ON);
+	} else if (strncmp(input, "J7_ON", 5) == 0) {
+		sendToUSB(dev_handle, J7_ON);
+	} else if (strncmp(input, "J8_ON", 5) == 0) {
+		sendToUSB(dev_handle, J8_ON);
+	} else if (strncmp(input, "J9_ON", 5) == 0) {
+		sendToUSB(dev_handle, J9_ON);
+	} else if (strncmp(input, "J10_ON", 6) == 0) {
+		sendToUSB(dev_handle, J10_ON);
+	} else if (strncmp(input, "J11_ON", 6) == 0) {
+		sendToUSB(dev_handle, J11_ON);
+	} else if (strncmp(input, "J12_ON", 6) == 0) {
+		sendToUSB(dev_handle, J12_ON);
+	} else if (strncmp(input, "J13_ON", 6) == 0) {
+		sendToUSB(dev_handle, J13_ON);
+	} else if (strncmp(input, "J14_ON", 6) == 0) {
+		sendToUSB(dev_handle, J14_ON);
+	} else if (strncmp(input, "J15_ON", 6) == 0) {
+		sendToUSB(dev_handle, J15_ON);
+	} else if (strncmp(input, "J16_ON", 6) == 0) {
+		sendToUSB(dev_handle, J16_ON);
+	} else if (strncmp(input, "J1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J1_OFF);
+	} else if (strncmp(input, "J2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J2_OFF);
+	} else if (strncmp(input, "J3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J3_OFF);
+	} else if (strncmp(input, "J4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J4_OFF);
+	} else if (strncmp(input, "J5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J5_OFF);
+	} else if (strncmp(input, "J6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J6_OFF);
+	} else if (strncmp(input, "J7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J7_OFF);
+	} else if (strncmp(input, "J8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J8_OFF);
+	} else if (strncmp(input, "J9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, J9_OFF);
+	} else if (strncmp(input, "J10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, J10_OFF);
+	} else if (strncmp(input, "J11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, J11_OFF);
+	} else if (strncmp(input, "J12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, J12_OFF);
+	} else if (strncmp(input, "J13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, J13_OFF);
+	} else if (strncmp(input, "J14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, J14_OFF);
+	} else if (strncmp(input, "J15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, J15_OFF);
+	} else if (strncmp(input, "J16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, J16_OFF);
+	} else if (strncmp(input, "K1_ON", 5) == 0) {
+		sendToUSB(dev_handle, K1_ON);
+	} else if (strncmp(input, "K2_ON", 5) == 0) {
+		sendToUSB(dev_handle, K2_ON);
+	} else if (strncmp(input, "K3_ON", 5) == 0) {
+		sendToUSB(dev_handle, K3_ON);
+	} else if (strncmp(input, "K4_ON", 5) == 0) {
+		sendToUSB(dev_handle, K4_ON);
+	} else if (strncmp(input, "K5_ON", 5) == 0) {
+		sendToUSB(dev_handle, K5_ON);
+	} else if (strncmp(input, "K6_ON", 5) == 0) {
+		sendToUSB(dev_handle, K6_ON);
+	} else if (strncmp(input, "K7_ON", 5) == 0) {
+		sendToUSB(dev_handle, K7_ON);
+	} else if (strncmp(input, "K8_ON", 5) == 0) {
+		sendToUSB(dev_handle, K8_ON);
+	} else if (strncmp(input, "K9_ON", 5) == 0) {
+		sendToUSB(dev_handle, K9_ON);
+	} else if (strncmp(input, "K10_ON", 6) == 0) {
+		sendToUSB(dev_handle, K10_ON);
+	} else if (strncmp(input, "K11_ON", 6) == 0) {
+		sendToUSB(dev_handle, K11_ON);
+	} else if (strncmp(input, "K12_ON", 6) == 0) {
+		sendToUSB(dev_handle, K12_ON);
+	} else if (strncmp(input, "K13_ON", 6) == 0) {
+		sendToUSB(dev_handle, K13_ON);
+	} else if (strncmp(input, "K14_ON", 6) == 0) {
+		sendToUSB(dev_handle, K14_ON);
+	} else if (strncmp(input, "K15_ON", 6) == 0) {
+		sendToUSB(dev_handle, K15_ON);
+	} else if (strncmp(input, "K16_ON", 6) == 0) {
+		sendToUSB(dev_handle, K16_ON);
+	} else if (strncmp(input, "K1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K1_OFF);
+	} else if (strncmp(input, "K2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K2_OFF);
+	} else if (strncmp(input, "K3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K3_OFF);
+	} else if (strncmp(input, "K4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K4_OFF);
+	} else if (strncmp(input, "K5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K5_OFF);
+	} else if (strncmp(input, "K6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K6_OFF);
+	} else if (strncmp(input, "K7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K7_OFF);
+	} else if (strncmp(input, "K8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K8_OFF);
+	} else if (strncmp(input, "K9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, K9_OFF);
+	} else if (strncmp(input, "K10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, K10_OFF);
+	} else if (strncmp(input, "K11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, K11_OFF);
+	} else if (strncmp(input, "K12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, K12_OFF);
+	} else if (strncmp(input, "K13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, K13_OFF);
+	} else if (strncmp(input, "K14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, K14_OFF);
+	} else if (strncmp(input, "K15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, K15_OFF);
+	} else if (strncmp(input, "K16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, K16_OFF);
+	} else if (strncmp(input, "L1_ON", 5) == 0) {
+		sendToUSB(dev_handle, L1_ON);
+	} else if (strncmp(input, "L2_ON", 5) == 0) {
+		sendToUSB(dev_handle, L2_ON);
+	} else if (strncmp(input, "L3_ON", 5) == 0) {
+		sendToUSB(dev_handle, L3_ON);
+	} else if (strncmp(input, "L4_ON", 5) == 0) {
+		sendToUSB(dev_handle, L4_ON);
+	} else if (strncmp(input, "L5_ON", 5) == 0) {
+		sendToUSB(dev_handle, L5_ON);
+	} else if (strncmp(input, "L6_ON", 5) == 0) {
+		sendToUSB(dev_handle, L6_ON);
+	} else if (strncmp(input, "L7_ON", 5) == 0) {
+		sendToUSB(dev_handle, L7_ON);
+	} else if (strncmp(input, "L8_ON", 5) == 0) {
+		sendToUSB(dev_handle, L8_ON);
+	} else if (strncmp(input, "L9_ON", 5) == 0) {
+		sendToUSB(dev_handle, L9_ON);
+	} else if (strncmp(input, "L10_ON", 6) == 0) {
+		sendToUSB(dev_handle, L10_ON);
+	} else if (strncmp(input, "L11_ON", 6) == 0) {
+		sendToUSB(dev_handle, L11_ON);
+	} else if (strncmp(input, "L12_ON", 6) == 0) {
+		sendToUSB(dev_handle, L12_ON);
+	} else if (strncmp(input, "L13_ON", 6) == 0) {
+		sendToUSB(dev_handle, L13_ON);
+	} else if (strncmp(input, "L14_ON", 6) == 0) {
+		sendToUSB(dev_handle, L14_ON);
+	} else if (strncmp(input, "L15_ON", 6) == 0) {
+		sendToUSB(dev_handle, L15_ON);
+	} else if (strncmp(input, "L16_ON", 6) == 0) {
+		sendToUSB(dev_handle, L16_ON);
+	} else if (strncmp(input, "L1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L1_OFF);
+	} else if (strncmp(input, "L2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L2_OFF);
+	} else if (strncmp(input, "L3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L3_OFF);
+	} else if (strncmp(input, "L4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L4_OFF);
+	} else if (strncmp(input, "L5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L5_OFF);
+	} else if (strncmp(input, "L6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L6_OFF);
+	} else if (strncmp(input, "L7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L7_OFF);
+	} else if (strncmp(input, "L8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L8_OFF);
+	} else if (strncmp(input, "L9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, L9_OFF);
+	} else if (strncmp(input, "L10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, L10_OFF);
+	} else if (strncmp(input, "L11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, L11_OFF);
+	} else if (strncmp(input, "L12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, L12_OFF);
+	} else if (strncmp(input, "L13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, L13_OFF);
+	} else if (strncmp(input, "L14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, L14_OFF);
+	} else if (strncmp(input, "L15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, L15_OFF);
+	} else if (strncmp(input, "L16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, L16_OFF);
+	} else if (strncmp(input, "M1_ON", 5) == 0) {
+		sendToUSB(dev_handle, M1_ON);
+	} else if (strncmp(input, "M2_ON", 5) == 0) {
+		sendToUSB(dev_handle, M2_ON);
+	} else if (strncmp(input, "M3_ON", 5) == 0) {
+		sendToUSB(dev_handle, M3_ON);
+	} else if (strncmp(input, "M4_ON", 5) == 0) {
+		sendToUSB(dev_handle, M4_ON);
+	} else if (strncmp(input, "M5_ON", 5) == 0) {
+		sendToUSB(dev_handle, M5_ON);
+	} else if (strncmp(input, "M6_ON", 5) == 0) {
+		sendToUSB(dev_handle, M6_ON);
+	} else if (strncmp(input, "M7_ON", 5) == 0) {
+		sendToUSB(dev_handle, M7_ON);
+	} else if (strncmp(input, "M8_ON", 5) == 0) {
+		sendToUSB(dev_handle, M8_ON);
+	} else if (strncmp(input, "M9_ON", 5) == 0) {
+		sendToUSB(dev_handle, M9_ON);
+	} else if (strncmp(input, "M10_ON", 6) == 0) {
+		sendToUSB(dev_handle, M10_ON);
+	} else if (strncmp(input, "M11_ON", 6) == 0) {
+		sendToUSB(dev_handle, M11_ON);
+	} else if (strncmp(input, "M12_ON", 6) == 0) {
+		sendToUSB(dev_handle, M12_ON);
+	} else if (strncmp(input, "M13_ON", 6) == 0) {
+		sendToUSB(dev_handle, M13_ON);
+	} else if (strncmp(input, "M14_ON", 6) == 0) {
+		sendToUSB(dev_handle, M14_ON);
+	} else if (strncmp(input, "M15_ON", 6) == 0) {
+		sendToUSB(dev_handle, M15_ON);
+	} else if (strncmp(input, "M16_ON", 6) == 0) {
+		sendToUSB(dev_handle, M16_ON);
+	} else if (strncmp(input, "M1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M1_OFF);
+	} else if (strncmp(input, "M2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M2_OFF);
+	} else if (strncmp(input, "M3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M3_OFF);
+	} else if (strncmp(input, "M4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M4_OFF);
+	} else if (strncmp(input, "M5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M5_OFF);
+	} else if (strncmp(input, "M6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M6_OFF);
+	} else if (strncmp(input, "M7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M7_OFF);
+	} else if (strncmp(input, "M8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M8_OFF);
+	} else if (strncmp(input, "M9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, M9_OFF);
+	} else if (strncmp(input, "M10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, M10_OFF);
+	} else if (strncmp(input, "M11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, M11_OFF);
+	} else if (strncmp(input, "M12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, M12_OFF);
+	} else if (strncmp(input, "M13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, M13_OFF);
+	} else if (strncmp(input, "M14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, M14_OFF);
+	} else if (strncmp(input, "M15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, M15_OFF);
+	} else if (strncmp(input, "M16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, M16_OFF);
+	} else if (strncmp(input, "N1_ON", 5) == 0) {
+		sendToUSB(dev_handle, N1_ON);
+	} else if (strncmp(input, "N2_ON", 5) == 0) {
+		sendToUSB(dev_handle, N2_ON);
+	} else if (strncmp(input, "N3_ON", 5) == 0) {
+		sendToUSB(dev_handle, N3_ON);
+	} else if (strncmp(input, "N4_ON", 5) == 0) {
+		sendToUSB(dev_handle, N4_ON);
+	} else if (strncmp(input, "N5_ON", 5) == 0) {
+		sendToUSB(dev_handle, N5_ON);
+	} else if (strncmp(input, "N6_ON", 5) == 0) {
+		sendToUSB(dev_handle, N6_ON);
+	} else if (strncmp(input, "N7_ON", 5) == 0) {
+		sendToUSB(dev_handle, N7_ON);
+	} else if (strncmp(input, "N8_ON", 5) == 0) {
+		sendToUSB(dev_handle, N8_ON);
+	} else if (strncmp(input, "N9_ON", 5) == 0) {
+		sendToUSB(dev_handle, N9_ON);
+	} else if (strncmp(input, "N10_ON", 6) == 0) {
+		sendToUSB(dev_handle, N10_ON);
+	} else if (strncmp(input, "N11_ON", 6) == 0) {
+		sendToUSB(dev_handle, N11_ON);
+	} else if (strncmp(input, "N12_ON", 6) == 0) {
+		sendToUSB(dev_handle, N12_ON);
+	} else if (strncmp(input, "N13_ON", 6) == 0) {
+		sendToUSB(dev_handle, N13_ON);
+	} else if (strncmp(input, "N14_ON", 6) == 0) {
+		sendToUSB(dev_handle, N14_ON);
+	} else if (strncmp(input, "N15_ON", 6) == 0) {
+		sendToUSB(dev_handle, N15_ON);
+	} else if (strncmp(input, "N16_ON", 6) == 0) {
+		sendToUSB(dev_handle, N16_ON);
+	} else if (strncmp(input, "N1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N1_OFF);
+	} else if (strncmp(input, "N2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N2_OFF);
+	} else if (strncmp(input, "N3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N3_OFF);
+	} else if (strncmp(input, "N4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N4_OFF);
+	} else if (strncmp(input, "N5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N5_OFF);
+	} else if (strncmp(input, "N6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N6_OFF);
+	} else if (strncmp(input, "N7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N7_OFF);
+	} else if (strncmp(input, "N8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N8_OFF);
+	} else if (strncmp(input, "N9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, N9_OFF);
+	} else if (strncmp(input, "N10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, N10_OFF);
+	} else if (strncmp(input, "N11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, N11_OFF);
+	} else if (strncmp(input, "N12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, N12_OFF);
+	} else if (strncmp(input, "N13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, N13_OFF);
+	} else if (strncmp(input, "N14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, N14_OFF);
+	} else if (strncmp(input, "N15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, N15_OFF);
+	} else if (strncmp(input, "N16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, N16_OFF);
+	} else if (strncmp(input, "O1_ON", 5) == 0) {
+		sendToUSB(dev_handle, O1_ON);
+	} else if (strncmp(input, "O2_ON", 5) == 0) {
+		sendToUSB(dev_handle, O2_ON);
+	} else if (strncmp(input, "O3_ON", 5) == 0) {
+		sendToUSB(dev_handle, O3_ON);
+	} else if (strncmp(input, "O4_ON", 5) == 0) {
+		sendToUSB(dev_handle, O4_ON);
+	} else if (strncmp(input, "O5_ON", 5) == 0) {
+		sendToUSB(dev_handle, O5_ON);
+	} else if (strncmp(input, "O6_ON", 5) == 0) {
+		sendToUSB(dev_handle, O6_ON);
+	} else if (strncmp(input, "O7_ON", 5) == 0) {
+		sendToUSB(dev_handle, O7_ON);
+	} else if (strncmp(input, "O8_ON", 5) == 0) {
+		sendToUSB(dev_handle, O8_ON);
+	} else if (strncmp(input, "O9_ON", 5) == 0) {
+		sendToUSB(dev_handle, O9_ON);
+	} else if (strncmp(input, "O10_ON", 6) == 0) {
+		sendToUSB(dev_handle, O10_ON);
+	} else if (strncmp(input, "O11_ON", 6) == 0) {
+		sendToUSB(dev_handle, O11_ON);
+	} else if (strncmp(input, "O12_ON", 6) == 0) {
+		sendToUSB(dev_handle, O12_ON);
+	} else if (strncmp(input, "O13_ON", 6) == 0) {
+		sendToUSB(dev_handle, O13_ON);
+	} else if (strncmp(input, "O14_ON", 6) == 0) {
+		sendToUSB(dev_handle, O14_ON);
+	} else if (strncmp(input, "O15_ON", 6) == 0) {
+		sendToUSB(dev_handle, O15_ON);
+	} else if (strncmp(input, "O16_ON", 6) == 0) {
+		sendToUSB(dev_handle, O16_ON);
+	} else if (strncmp(input, "O1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O1_OFF);
+	} else if (strncmp(input, "O2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O2_OFF);
+	} else if (strncmp(input, "O3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O3_OFF);
+	} else if (strncmp(input, "O4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O4_OFF);
+	} else if (strncmp(input, "O5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O5_OFF);
+	} else if (strncmp(input, "O6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O6_OFF);
+	} else if (strncmp(input, "O7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O7_OFF);
+	} else if (strncmp(input, "O8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O8_OFF);
+	} else if (strncmp(input, "O9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, O9_OFF);
+	} else if (strncmp(input, "O10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, O10_OFF);
+	} else if (strncmp(input, "O11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, O11_OFF);
+	} else if (strncmp(input, "O12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, O12_OFF);
+	} else if (strncmp(input, "O13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, O13_OFF);
+	} else if (strncmp(input, "O14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, O14_OFF);
+	} else if (strncmp(input, "O15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, O15_OFF);
+	} else if (strncmp(input, "O16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, O16_OFF);
+	} else if (strncmp(input, "P1_ON", 5) == 0) {
+		sendToUSB(dev_handle, P1_ON);
+	} else if (strncmp(input, "P2_ON", 5) == 0) {
+		sendToUSB(dev_handle, P2_ON);
+	} else if (strncmp(input, "P3_ON", 5) == 0) {
+		sendToUSB(dev_handle, P3_ON);
+	} else if (strncmp(input, "P4_ON", 5) == 0) {
+		sendToUSB(dev_handle, P4_ON);
+	} else if (strncmp(input, "P5_ON", 5) == 0) {
+		sendToUSB(dev_handle, P5_ON);
+	} else if (strncmp(input, "P6_ON", 5) == 0) {
+		sendToUSB(dev_handle, P6_ON);
+	} else if (strncmp(input, "P7_ON", 5) == 0) {
+		sendToUSB(dev_handle, P7_ON);
+	} else if (strncmp(input, "P8_ON", 5) == 0) {
+		sendToUSB(dev_handle, P8_ON);
+	} else if (strncmp(input, "P9_ON", 5) == 0) {
+		sendToUSB(dev_handle, P9_ON);
+	} else if (strncmp(input, "P10_ON", 6) == 0) {
+		sendToUSB(dev_handle, P10_ON);
+	} else if (strncmp(input, "P11_ON", 6) == 0) {
+		sendToUSB(dev_handle, P11_ON);
+	} else if (strncmp(input, "P12_ON", 6) == 0) {
+		sendToUSB(dev_handle, P12_ON);
+	} else if (strncmp(input, "P13_ON", 6) == 0) {
+		sendToUSB(dev_handle, P13_ON);
+	} else if (strncmp(input, "P14_ON", 6) == 0) {
+		sendToUSB(dev_handle, P14_ON);
+	} else if (strncmp(input, "P15_ON", 6) == 0) {
+		sendToUSB(dev_handle, P15_ON);
+	} else if (strncmp(input, "P16_ON", 6) == 0) {
+		sendToUSB(dev_handle, P16_ON);
+	} else if (strncmp(input, "P1_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P1_OFF);
+	} else if (strncmp(input, "P2_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P2_OFF);
+	} else if (strncmp(input, "P3_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P3_OFF);
+	} else if (strncmp(input, "P4_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P4_OFF);
+	} else if (strncmp(input, "P5_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P5_OFF);
+	} else if (strncmp(input, "P6_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P6_OFF);
+	} else if (strncmp(input, "P7_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P7_OFF);
+	} else if (strncmp(input, "P8_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P8_OFF);
+	} else if (strncmp(input, "P9_OFF", 6) == 0) {
+		sendToUSB(dev_handle, P9_OFF);
+	} else if (strncmp(input, "P10_OFF", 7) == 0) {
+		sendToUSB(dev_handle, P10_OFF);
+	} else if (strncmp(input, "P11_OFF", 7) == 0) {
+		sendToUSB(dev_handle, P11_OFF);
+	} else if (strncmp(input, "P12_OFF", 7) == 0) {
+		sendToUSB(dev_handle, P12_OFF);
+	} else if (strncmp(input, "P13_OFF", 7) == 0) {
+		sendToUSB(dev_handle, P13_OFF);
+	} else if (strncmp(input, "P14_OFF", 7) == 0) {
+		sendToUSB(dev_handle, P14_OFF);
+	} else if (strncmp(input, "P15_OFF", 7) == 0) {
+		sendToUSB(dev_handle, P15_OFF);
+	} else if (strncmp(input, "P16_OFF", 7) == 0) {
+		sendToUSB(dev_handle, P16_OFF);
+	} else if (strncmp(input, "quit", 4) == 0
+			|| strncmp(input, "exit", 4) == 0) {
+		return -1;
+	}
+	return 0;
+}
+
+int main() {
+	struct sockaddr_in client, server;
+
+	int sock, fd;
+	unsigned int len;
+	sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+
+	memset(&server, 0, sizeof(server));
+
+	server.sin_family = AF_INET;
+	server.sin_addr.s_addr = htonl(INADDR_ANY);
+	server.sin_port = htons(PORT);
+
+	if (bind(sock, (struct sockaddr*) &server, sizeof(server)) < 0) {
+		printf("Can't bind socket");
+		return (-1);
+	}
+
+	if (listen(sock, 5) == -1) {
+		printf("Can't listen on socket");
+		return (-1);
+	}
+	printf("server listeting...");
+	libusb_device_handle *dev_handle;
+	libusb_context *usbContext = NULL;
+	int r; //for return values
+	r = libusb_init(&usbContext);
+	if (r < 0) {
+		printf("Init Error %i\n", r);
+		return 1;
+	}
+
+	dev_handle = libusb_open_device_with_vid_pid(usbContext, 5824, 2610); //VendorID and ProductID in decimal
+	if (dev_handle == NULL)
+		printf("Cannot open device");
+
+	if (libusb_kernel_driver_active(dev_handle, 0) == 1) {
+		printf("Kernel Driver Active");
+		if (libusb_detach_kernel_driver(dev_handle, 0) == 0)
+			printf("Kernel Driver Detached!");
+	}
+	r = libusb_claim_interface(dev_handle, 0);
+	if (r < 0) {
+		printf("Cannot Claim Interface");
+		return 1;
+	}
+
+	while (1) {
+		len = sizeof(client);
+		fd = accept(sock, (struct sockaddr*) &client, &len);
+		if (fd < 0) {
+			printf("Error, can't accept connection");
+			return -1;
+		}
+		char* receiveBuffer[RECEIVE_BUFFER];
+		while (recv(fd, receiveBuffer, RECEIVE_BUFFER, 0) != -1) {
+
+			if (handleInput(receiveBuffer, dev_handle) == -1) {
+				close(fd);
+			}
+
+		}
+	}
+
+	r = libusb_release_interface(dev_handle, 0);
+	if (r != 0) {
+		printf("Cannot Release Interface");
+		return 1;
+	}
+
+	libusb_close(dev_handle);
+	libusb_exit(usbContext);
+	return 0;
+}
diff -Naur '--exclude=.*' make/lightmanager.orig/src/Makefile make/lightmanager/src/Makefile
--- make/lightmanager.orig/src/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ make/lightmanager/src/Makefile	2012-07-03 15:03:41.000000000 +0200
@@ -0,0 +1,13 @@
+# Name        : LightManagerC.c
+# Author      : zwiebelchen
+# Version     :
+# Copyright   : GPL
+# Description : LightManagerC
+
+CC=
+CFLAGS=
+
+all: lightmanager
+
+lightmanager: lightmanager.c
+	${CC} ${CFLAGS} -o lightmanager lightmanager.c -lusb-1.0
Code:
mkdir -p packages/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1/root
if test -d make/lightmanager/files; then tar -c -C make/lightmanager/files --exclude=.svn . | tar -x -C packages/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1 ; fi
---> package/lightmanager: preparing... mkdir -p source/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1
cp -a make/lightmanager/src/actors.h make/lightmanager/src/lightmanager.c make/lightmanager/src/Makefile source/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1
cmd() { PATH="/home/gm/myfreetz/freetz9154/freetz-devel/toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin:/home/gm/myfreetz/freetz9154/freetz-devel/toolchain/build/mipsel_gcc-4.6.3/mipsel-unknown-linux-gnu/bin:/usr/lib64/mpi/gcc/openmpi/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/opt/cross/bin" LD_RUN_PATH="/usr/lib/freetz" make -j2  "$@"  || { printf "\n\\033[33m%s\\033[m\n" "ERROR: Build failed.";  exit 1; } };     if [ -e source/.echo_item_start -a ! -e source/.echo_item_build ]; then echo -n "building... "; touch source/.echo_item_build; fi; cmd -C source/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1 \
                CC="/home/gm/myfreetz/freetz9154/freetz-devel/toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-gcc" \
                CFLAGS="-march=4kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
building... make[1]: Entering directory `/home/gm/myfreetz/freetz9154/freetz-devel/source/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1'
/home/gm/myfreetz/freetz9154/freetz-devel/toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-gcc -march=4kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o lightmanager lightmanager.c -lusb-1.0
lightmanager.c: In function 'main':
lightmanager.c:1129:4: warning: passing argument 1 of 'handleInput' from incompatible pointer type [enabled by default]
lightmanager.c:39:5: note: expected 'char *' but argument is of type 'char **'
make[1]: Leaving directory `/home/gm/myfreetz/freetz9154/freetz-devel/source/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1'
mkdir -p packages/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1/root/usr/bin/; cp source/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1/lightmanager packages/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1/root/usr/bin/lightmanager; /home/gm/myfreetz/freetz9154/freetz-devel/toolchain/build/mipsel_gcc-4.6.3_uClibc-0.9.32.1/mipsel-linux-uclibc/bin/mipsel-linux-uclibc-strip --remove-section={.comment,.note,.pdr} packages/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1/root/usr/bin/lightmanager;
done.
Code:
:~/myfreetz/freetz9154/freetz-devel> file packages/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1/root/usr/bin/lightmanager
packages/target-mipsel_uClibc-0.9.32.1/lightmanager-0.1/root/usr/bin/lightmanager: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x3040000, stripped
Code:
root@fritz:/var/media/ftp/uStor02/archiv# ldd ./lightmanager
        libusb-1.0.so.0 => not found
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2aabe000)
        libc.so.0 => /lib/libc.so.0 (0x2aadc000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)
 
Versuch es mal hiermit:
Code:
int handleInput(char* input, libusb_device_handle* dev_handle)
{
  printf("Handling input...");
  if (strncmp(input, "quit", 4) == 0 || strncmp(input, "exit", 4) == 0)
    return -1;
  if (input[0] >= 'A' && input[0] <= 'P') {
    char *cp;
    int num = strtol (input + 1, &cp, 10);
    int state;
    int port;
    if (strncmp (cp, "_ON", 3) == 0)
      state = 1;
    else if (strncmp (cp, "_OFF", 4) == 0)
      state = 0;
    else
      state = -1;
    if (num >= 1 && num <= 16 && state >= 0) {
      static char cmd[8] = { 0x05, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
      port = (input[0] - 'A') * 0x10 + (num - 1);
      cmd[1] = port;
      cmd[2] = state;
      if (port < 5)
        sendToUSB(dev_handle, 0);
      else
        sendToUSB(dev_handle, cmd);
    }
  }
}
Diese Variante braucht nur ca. 400 Bytes und nicht knapp 33kB. Wahrscheinlich ist sie auch noch schneller.
 
Die header-Datei (actors.h) wird nicht (mehr) benötigt:
Code:
/*
 lightmanager.c
 ============================================================================
 Name        : LightManagerC.c
 Author      : zwiebelchen
 Version     : 
 Copyright   : GPL
 Description : LightManagerC
 ============================================================================
 */

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <libusb-1.0/libusb.h>
#include <fcntl.h>
#include <errno.h>
#include <time.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <unistd.h>

static const int PORT = 3456;
static const int RECEIVE_BUFFER = 1024;

void sendToUSB(libusb_device_handle* dev_handle, unsigned char* deviceCode) {
	int actual;
	libusb_interrupt_transfer(dev_handle, (1 | LIBUSB_ENDPOINT_OUT), deviceCode,
			8, &actual, 8);
	libusb_interrupt_transfer(dev_handle, (0x82 | LIBUSB_ENDPOINT_IN),
			deviceCode, 8, &actual, 8);
}

int handleInput(char* input, libusb_device_handle* dev_handle)
{
  printf("Handling input...");
  if (strncmp(input, "quit", 4) == 0 || strncmp(input, "exit", 4) == 0)
    return -1;
  if (input[0] >= 'A' && input[0] <= 'P') {
    char *cp;
    int num = strtol (input + 1, &cp, 10);
    int state;
    int port;
    if (strncmp (cp, "_ON", 3) == 0)
      state = 1;
    else if (strncmp (cp, "_OFF", 4) == 0)
      state = 0;
    else
      state = -1;
    if (num >= 1 && num <= 16 && state >= 0) {
      static char cmd[8] = { 0x05, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00};
      port = (input[0] - 'A') * 0x10 + (num - 1);
      cmd[1] = port;
      cmd[2] = state;
      if (port < 5)
        sendToUSB(dev_handle, 0);
      else
        sendToUSB(dev_handle, cmd);
    }
  }
}

int main(int argc, char * argv[]) {
	struct sockaddr_in client, server;

	int sock, fd;
	unsigned int len;
	sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);

	memset(&server, 0, sizeof(server));

	server.sin_family = AF_INET;
	server.sin_addr.s_addr = htonl(INADDR_ANY);
	server.sin_port = htons(PORT);

	if (bind(sock, (struct sockaddr*) &server, sizeof(server)) < 0) {
		printf("Can't bind socket");
		return (-1);
	}

	if (listen(sock, 5) == -1) {
		printf("Can't listen on socket");
		return (-1);
	}
	printf("server listeting...");
	libusb_device_handle *dev_handle;
	libusb_context *usbContext = NULL;
	int r; //for return values
	r = libusb_init(&usbContext);
	if (r < 0) {
		printf("Init Error %i\n", r);
		return 1;
	}

	dev_handle = libusb_open_device_with_vid_pid(usbContext, 5824, 2610); /*VendorID and ProductID in decimal*/
	if (dev_handle == NULL)
		printf("Cannot open device");

	if (libusb_kernel_driver_active(dev_handle, 0) == 1) {
		printf("Kernel Driver Active");
		if (libusb_detach_kernel_driver(dev_handle, 0) == 0)
			printf("Kernel Driver Detached!");
	}
	r = libusb_claim_interface(dev_handle, 0);
	if (r < 0) {
		printf("Cannot Claim Interface");
		return 1;
	}

	while (1) {
		len = sizeof(client);
		fd = accept(sock, (struct sockaddr*) &client, &len);
		if (fd < 0) {
			printf("Error, can't accept connection");
			return -1;
		}
		char* receiveBuffer[RECEIVE_BUFFER];
		while (recv(fd, receiveBuffer, RECEIVE_BUFFER, 0) != -1) {

			if (handleInput((char *) receiveBuffer, dev_handle) == -1) {
				close(fd);
			}

		}
	}

	r = libusb_release_interface(dev_handle, 0);
	if (r != 0) {
		printf("Cannot Release Interface");
		return 1;
	}

	libusb_close(dev_handle);
	libusb_exit(usbContext);
	return 0;
}
 
Die header-Datei (actors.h) wird nicht (mehr) benötigt:
Genau, das spart ca. 4kB ein. Der Rest kommt von der if-strncmp-else Liste.
Die Frage ist aber, ob das Programm immer noch das tut, was es soll.

Außerdem frage ich mich, warum in den ersten fünf Fällen 0 geschickt wird, statt das dafür definierte Kommando.
 
Danke für die fleißigen Antworten !

So, wie ihr vorgeschlagen habt, scheint es nach wie vor zu laufen und die Header-Datei kann ich mir sparen...
(getestet mit "C3_ON", "C3_OFF", "P16_ON", "P16_OFF")

Die Compilerwarnung sollte auch weg sein, habe gecastet.

Code:
+config FREETZ_PACKAGE_LIGHTMANAGER
+	bool "lightmanager 0.1 (binary only)"
+	select FREETZ_LIB_libusb_1
+	default n
+	help
+		It's a little linux server program which allows you to control
+		your jbmedia LightManager connected via USB. The program uses
+		LibUSB 1.0 and a few standart Linux network headers. 
+		IPPF: http://www.ip-phone-forum.de/showthread.php?t=249984
+		WWW: https://code.google.com/p/light-manager-c/
Sollte man hier nicht vielleicht noch den Port und ein oder zwei Beispiel-Commands reinschreiben ?

Es wäre nett, wenn mal einer von euch statisch (oder von mir aus dynamisch) Linken könnte und es bei sich testet, denn ich Blick da noch nicht so ganz durch beim Kompilieren für die Fritz!Box. Habe HelloWorld hinbekommen, aber dann war Ende :p

Oder ist das schon in Freetz eingeflossen (testing / unstable ?), dass ich mir damit eine Version bauen kann (und es über make menuconfig einbinden kann) ?

Edit:

Neben "_ON" und "_OFF" kann man nun auch "toggeln" (z.B. "A1_TOGGLE") !
 
Zuletzt bearbeitet:
So, wie ihr vorgeschlagen habt, scheint es nach wie vor zu laufen und die Header-Datei kann ich mir sparen...
(getestet mit "C3_ON", "C3_OFF", "P16_ON", "P16_OFF")
Gibt es einen Grund, warum Du bei A1_ON bis A5_ON nicht das entsprechend definierte Kommando sendest, sondern 0?
Sollte man hier nicht vielleicht noch den Port und ein oder zwei Beispiel-Commands reinschreiben ?
Bei der Hilfe geht es nur darum, ob man das Programm auswählen will oder nicht. Dafür stehen da ein paar Zeilen, die beschreiben, was das Programm tut. Es geht nicht darum, die Anleitung zu hinterlegen, wie das Programm verwendet wird. Was meinst Du, was man sonst für umfangreichere Programme wir Apache oder Samba da schreiben müsste.
 
Gibt es einen Grund, warum Du bei A1_ON bis A5_ON nicht das entsprechend definierte Kommando sendest, sondern 0?
Das ist in der Tat falsch, aber war das nicht dein Vorschlag (Post #3) ?

Habe es gefixt...
 
Das war nicht mein Vorschlag, sondern bezog sich auf den Beitrag davor, in dem das gleiche Verhalten ist. Ich wollte nicht das Verhalten des Programms ändern, sondern es nur kürzer und schneller machen.
Code:
+	if (strncmp(input, "A1_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A2_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A3_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A4_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A5_ON", 5) == 0) {
+		sendToUSB(dev_handle, 0);
+	} else if (strncmp(input, "A6_ON", 5) == 0) {
+		sendToUSB(dev_handle, A6_ON);
+	} else if (strncmp(input, "A7_ON", 5) == 0) {
+		sendToUSB(dev_handle, A7_ON);
+...
 
Es wäre nett, wenn mal einer von euch statisch (oder von mir aus dynamisch) Linken könnte und es bei sich testet, denn ich Blick da noch nicht so ganz durch beim Kompilieren für die Fritz!Box. Habe HelloWorld hinbekommen, aber dann war Ende :p
Wenn Du HelloWorld schon kompiliert hast, dann solltest Du dein lightmanager, auch kompilieren können:
1. aktuellen freetz trunk auschecken
2. source code (... auch schon gecastet ;-) )aus Beitrag #5, in dein Freetz-Wurzelverzeichnis kopieren
3. "make menuconfig", deine Box auswählen und speichern
4. "make libusb1-precompiled"
5. binary statisch gelinkt kompilieren. Im Freetz-Wurzelverzeichnis (... bei copy&paste auf die gcc- und uClibc-Version achten!!):
Code:
./toolchain/build/mipsel_gcc-x.x.x_uClibc-0.x.xx.x/mipsel-linux-uclibc/bin/mipsel-linux-gcc -v -o lightmanager lightmanager.c -lusb-1.0 -lpthread -static
6. file ./lightmanager
7. das binary im binär-modus auf deine Box übertragen
8. chmod 755 ./lightmanager
9. lightmanager testen/anwenden.
 
Ich habe es kompiliert bekommen und auf die Box geschoben. Größe nach Stripping ist mein ich ca. 233kB. Testen kann ich aber erst heute abend, bin im Moment unterwegs.

Aber schonmal Danke für's Kompilieren helfen :)
 
Ok, soweit, so gut...

Scheitere gerade am fehlenden zweiten USB-Port, das kann ich hoffentlich morgen mit einem Hub beheben (wenn ich einen finde :-D ).

Habe mal ein paar "printf" eingebaut und er bleibt genau da stehen, wo auch der PC hängen bleibt, wenn ich das Programm ohne angeschlossenen LightManager starte...

Wäre echt super, wenn es jemand auch mal testen könnte, der evtl. einen Hub / eine Box mit mehreren USB-Ports hat. Danke !

Edit:

Fuck:

Ausgabe von lsusb, mit und ohne Lightmanager (ohne sonstige USB-Devices):
/var/mod/root # lsusb
BUS=001
DEV=001
VID=0000
PID=0000
CLS=09
SCL=00
SPEED='full'
VER='1.1'
ISOC=0
INUM=1
ICLS1=09
ISCL1=00

FRITZ!Box Fon WLAN 7170 (fs) Firmware-Version 29.04.80
freetz-1.1.3

Freetz zu alt ?
FritzBox zu alt ?
Zu wenig USB-Power ? (aktiver USB-Hub ?)

Hier mal als binary (7170, static linked, trunk):
Lightmanager Binary
 
Zuletzt bearbeitet:
Gib mal auf dem PC ein "cat /proc/bus/usb/devices".
Wenn es sich um ein Low-Speed Gerät handelt, was angesichts der Anforderungen wahrscheinlich ist. dann erkennt die 7170 dieses nicht. Die 7270 ist in der Hinsicht besser, die 7320 wieder schlechter.
 
Hab nur "lsusb -v", "cat /proc/bus/usb/devices" geht nicht (Ordner usb enthält keine Dateien).

lsusb -v:
Code:
Bus 002 Device 006: ID 16c0:0a32 VOTI 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x16c0 VOTI
  idProduct          0x0a32 
  bcdDevice            0.00
  iManufacturer           1 JBMedia
  iProduct                2 Lightman Pro
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      43
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)
 
Ich weiß nicht, ob man daran die Geschwindigkeit ablesen kann.
Stecke mal das Gerät am PC aus und wieder ein, gib dann das Kommando "dmesg | tail" ein.
Es sollte eine Zeile in der Art dabei sein:
Code:
usb 4-4: new low speed USB device number 2 using ohci_hcd
 
Code:
[   69.292148] usb 2-1.4: new low-speed USB device number 6 using ehci_hcd
[   69.388517] usb 2-1.4: New USB device found, idVendor=16c0, idProduct=0a32
[   69.388522] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   69.388525] usb 2-1.4: Product: Lightman Pro
[   69.388527] usb 2-1.4: Manufacturer: JBMedia
[   69.391609] generic-usb 0003:16C0:0A32.0003: hiddev0,hidraw2: USB HID v1.11 Device [JBMedia Lightman Pro] on usb-0000:00:1d.7-1.4/input0

Super...

Kann man da nichts machen, damit er an der 7170 läuft ?
 
Sicher kann man da was machen. Die USB-Funktionalität steckt in einem programmierbaren Logik-Baustein.
Entweder man bringt AVM dazu, dass zu ändern, oder man macht es selbst. Dafür bräuchte man aber eine Dokumentation, oder man müsste alles von Grund auf neu machen, einschließlich der anderen Funktionen, die dieser Baustein hat.

Realistisch betrachtet wird AVM nichts ändern und auch keine Dokumentation heraus geben.

Ich würde einen TP-Link MR3220 dafür nehmen. Den gibt es neu für unter 30 Euro und damit funktionieren auch Low-Speed Geräte.
 
Da ich mit der 7170 wohl nicht weiter kommen, mein Projekt aber trotzdem voran treibe, hier mal ein kleines Statusupdate:

-FS20 Aktoren können angesprochen und gedimmt werden
-Szenen können ausgewählt werden

Schaut bei Interesse einfach mal auf die Projektseite...
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.