aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-13 20:32:02 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-13 20:32:02 +0200
commit44ee3d7e5ab82a5ab63a7c5180c758e94bd6e50b (patch)
treef5cfd0b195a0666ee0d150c1b85be43f9a9388c1
parentadd protocol for announcing new keyboards and removal of keyboards (diff)
downloadmds-44ee3d7e5ab82a5ab63a7c5180c758e94bd6e50b.tar.gz
mds-44ee3d7e5ab82a5ab63a7c5180c758e94bd6e50b.tar.bz2
mds-44ee3d7e5ab82a5ab63a7c5180c758e94bd6e50b.tar.xz
mds-kkbd: announce new keyboard when starting
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-kkbd.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mds-kkbd.c b/src/mds-kkbd.c
index 9444f7d..ef4f756 100644
--- a/src/mds-kkbd.c
+++ b/src/mds-kkbd.c
@@ -63,6 +63,7 @@
* The name of the keyboard for which its server implements control
*/
#define KEYBOARD_ID "kernel"
+/* NOTE: length hardcoded in `initialise_server` */
/**
* LED:s that we believe are pressent on the keyboard
@@ -95,7 +96,7 @@ server_characteristics_t server_characteristics =
/**
* Value of the ‘Message ID’ header for the next message
*/
-static int32_t message_id = 2;
+static int32_t message_id = 3;
/**
* Buffer for received messages
@@ -220,7 +221,13 @@ int initialise_server(void)
"Length: 59\n"
"\n"
"Command: enumerate-keyboards\n"
- "Command: keyboard-enumeration\n";
+ "Command: keyboard-enumeration\n"
+ /* NEXT MESSAGE */
+ "Command: new-keyboard\n"
+ "Message ID: 2\n"
+ "Length: 7\n"
+ "\n"
+ KEYBOARD_ID "\n";
fail_if (open_leds() < 0);
stage = 1;