summarylogtreecommitdiffstats
path: root/mx5500.h
diff options
context:
space:
mode:
Diffstat (limited to 'mx5500.h')
-rw-r--r--mx5500.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/mx5500.h b/mx5500.h
new file mode 100644
index 00000000000..bf0f2cd9f9b
--- /dev/null
+++ b/mx5500.h
@@ -0,0 +1,60 @@
+/* mx5500-set
+ * Tool to control the extra features of the Logitech MX 5500 bluetooth keyboard in hci mod based on Hidraw
+ *
+ * Copyright (c) 2013 Julian Sparber <julian@sparber.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MX5500_H
+#define MX5500_H
+
+/* Linux */
+#include <linux/types.h>
+#include <linux/input.h>
+#include <linux/hidraw.h>
+/*
+ * Ugly hack to work around failing compilation on systems that don't
+ * yet populate new version of hidraw.h to userspace.
+ */
+#ifndef HIDIOCSFEATURE
+#warning Please have your distro update the userspace kernel headers
+#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
+#endif
+
+/* Unix */
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* C */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <time.h>
+#include <math.h>
+
+int open_device(int fd);
+const char *bus_str(int bus);
+int set_time(int fd);
+int beep(int fd);
+int set_temp_unit(int fd, char unit, char mode);
+int no_arg();
+
+#endif /* MX5500_H */