summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/hidpp10.h15
-rw-r--r--lib/hidpp20.h12
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/hidpp10.h b/lib/hidpp10.h
index f8be8b0..0148c13 100644
--- a/lib/hidpp10.h
+++ b/lib/hidpp10.h
@@ -40,6 +40,21 @@
#define REG_PAIRING_INFO 0xB5
#define REG_VERSION_INFO 0xF1 /* undocumented */
+/* HID++ 1.0 error codes */
+#define HIDPP_ERR_SUCCESS 0x00
+#define HIDPP_ERR_INVALID_SUBID 0x01
+#define HIDPP_ERR_INVALID_ADDRESS 0x02
+#define HIDPP_ERR_INVALID_VALUE 0x03
+#define HIDPP_ERR_CONNECT_FAIL 0x04
+#define HIDPP_ERR_TOO_MANY_DEVICES 0x05
+#define HIDPP_ERR_ALREADY_EXISTS 0x06
+#define HIDPP_ERR_BUSY 0x07
+#define HIDPP_ERR_UNKNOWN_DEVICE 0x08
+#define HIDPP_ERR_RESOURCE_ERROR 0x09
+#define HIDPP_ERR_REQUEST_UNAVAILABLE 0x0A
+#define HIDPP_ERR_INVALID_PARAM_VALUE 0x0B
+#define HIDPP_ERR_WRONG_PIN_CODE 0x0C
+
/**
* Attempts to dispatch a register query.
*
diff --git a/lib/hidpp20.h b/lib/hidpp20.h
index 838f70c..49181e1 100644
--- a/lib/hidpp20.h
+++ b/lib/hidpp20.h
@@ -22,6 +22,18 @@
#include <stdint.h>
#include "hidpp.h"
+/* HID++ 2.0 error codes */
+#define HIDPP20_ERR_CODE_NOERROR 0x00
+#define HIDPP20_ERR_CODE_UNKNOWN 0x01
+#define HIDPP20_ERR_CODE_INVALIDARGUMENT 0x02
+#define HIDPP20_ERR_CODE_OUTOFRANGE 0x03
+#define HIDPP20_ERR_CODE_HWERROR 0x04
+#define HIDPP20_ERR_CODE_LOGITECH_INTERNAL 0x05
+#define HIDPP20_ERR_CODE_INVALID_FEATURE_INDEX 0x06
+#define HIDPP20_ERR_CODE_INVALID_FUNCTION_ID 0x07
+#define HIDPP20_ERR_CODE_BUSY 0x08
+#define HIDPP20_ERR_CODE_UNSUPPORTED 0x09
+
typedef struct {
uint8_t feature_index;
uint16_t feature_id;