[gnome-color-manager: 18/80] huey: it looks like there's a register read/copy going on at startup
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager: 18/80] huey: it looks like there's a register read/copy going on at startup
- Date: Mon, 19 Jul 2010 11:33:58 +0000 (UTC)
commit c78833c1d5b88d04fd39b6816b289501c27b1e71
Author: Richard Hughes <richard hughsie com>
Date: Sat Jul 17 22:45:40 2010 +0100
huey: it looks like there's a register read/copy going on at startup
src/gcm-huey-example.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/src/gcm-huey-example.c b/src/gcm-huey-example.c
index a7af1af..c724c7f 100644
--- a/src/gcm-huey-example.c
+++ b/src/gcm-huey-example.c
@@ -64,13 +64,13 @@
/* (sent at startup after the unlock)
* input: 08 0b 00 10 3c 06 00 00
- * ^^-- register address? We read from 0x04 to 0x72 at startup
+ * ^^-- register address
* returns: 00 08 0b b8 00 00 00 00
- *
+ * address --^^ ^^-- value
* input: 08 f1 f2 f3 f4 f5 f6 f7
* returns: 00 08 f1 f2 00 00 00 00
*/
-#define HUEY_COMMAND_UNKNOWN_08 0x08
+#define HUEY_COMMAND_UNKNOWN_REG_READ 0x08
/* returns: all NULL all of the time */
#define HUEY_COMMAND_UNLOCK 0x0e
@@ -359,21 +359,27 @@ out:
}
static gboolean
-do_thing_after_unlock (GcmPriv *priv, GError **error)
+read_registers (GcmPriv *priv, GError **error)
{
/* according to wMaxPacketSize, all the messages have just 8 bytes */
- guchar request[] = { HUEY_COMMAND_UNKNOWN_08, 0x0b, 0x00, 0x10, 0x3c, 0x06, 0x00, 0x00 };
+ guchar request[] = { HUEY_COMMAND_UNKNOWN_REG_READ, 0xff, 0x00, 0x10, 0x3c, 0x06, 0x00, 0x00 };
guchar reply[8];
gboolean ret;
gsize reply_read;
+ guchar i;
- /* just get data */
- ret = send_data (priv, request, 8, reply, 8, &reply_read, error);
- if (!ret)
- goto out;
+ /* We read from 0x04 to 0x72 at startup */
+ for (i=0x00; i<=0x72; i++) {
+
+ request[1] = i;
+ ret = send_data (priv, request, 8, reply, 8, &reply_read, error);
+ if (!ret)
+ goto out;
+
+ /* this seems like the only bit of data that's useful */
+ g_print ("register value: 0x%02x [%c]\n", reply[3], g_ascii_isprint (reply[3]) ? reply[3] : '?');
+ }
- /* this seems like the only bit of data that's useful */
- g_debug ("random thing that's checked: 0x%02x", reply[3]);
out:
return ret;
}
@@ -415,7 +421,7 @@ main (void)
}
/* this is done by the windows driver */
- ret = do_thing_after_unlock (priv, &error);
+ ret = read_registers (priv, &error);
if (!ret) {
g_warning ("failed to do thing: %s", error->message);
g_error_free (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]