2 * xkbd-bthid-wrapper (for Nokia770)
4 * (c) Collin R. Mulliner <collin@betaversion.net>
5 * http://www.mulliner.org/nokia770/
15 #define USAGE "\nxkbd-bthid-wrapper is wrapper for xkbd-bthid\n"\
16 " it reconfigures the hci0 device to be usable as a keyboard\n"\
17 " and also starts the sdpd service, to do this it needs to run with\n"\
18 " root privileges. these will be dropped before executing xkbd-bthid\n"\
19 " also the hci0 settings will be reverted to default values on exit\n"
21 int main(int argc, char **argv)
26 fprintf(stderr, "%s: needs root privileges\n", argv[0]);
27 fprintf(stderr, USAGE);
32 waitpid(pid, &status, 0);
35 execl("/usr/sbin/hciconfig", "hciconfig", "hci0", "piscan");
38 waitpid(pid, &status, 0);
41 execl("/usr/sbin/hciconfig", "hciconfig", "hci0", "class", "0x002540");
44 waitpid(pid, &status, 0);
47 execl("/usr/sbin/sdpd", "sdpd");
51 waitpid(pid, &status, 0);
54 waitpid(pid, &status, 0);
57 execl("/usr/sbin/hciconfig", "hciconfig", "hci0", "pscan");
60 waitpid(pid, &status, 0);
63 execl("/usr/sbin/hciconfig", "hciconfig", "hci0", "class", "0x00100");
69 execl("/var/lib/install/usr/bin/xkbdbthid", "xkbdbthid", argv[1], argv[2]);