#include <stdio.h>
#include <stdint.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+
+#include <linux/types.h>
+
+#include "hidraw.h"
+
#include "common.h"
#define MAXREPORTLEN 256
#define MAXREPORTS 256
+typedef struct { int len; uint8_t *msg; } Last;
+typedef struct { Last lasts[MAXREPORTS]; } LastReports;
typedef void ProcessReport(const uint8_t *msg, int msglen, const uint8_t *last);
extern const char *const descriptor;
extern ProcessReport *const report_processors[MAXREPORTS];
+void dispatch(LastReports *lasts, const char *message_prefix,
+ ProcessReport *const report_processors[MAXREPORTS],
+ const uint8_t *msg, int l);
+
+/*---------- specific reporters ----------*/
+
typedef struct {
const char *str;
int pos;
uint8_t mask;
} KeyBit;
+void reportbits(const uint8_t msg[], const uint8_t last[],
+ int len, const KeyBit keybits[]);
+
+
typedef struct {
const char *str;
int pos, rshift, sign; /* mask is applied before rshift */
uint8_t mask, zero;
} ValLoc;
-void reportbits(const uint8_t msg[], const uint8_t last[],
- int len, const KeyBit bits[]);
+void reportvals(const uint8_t msg[], const uint8_t last[],
+ int len, const ValLoc vallocs[]);
-void reportlocs(const uint8_t msg[], const uint8_t last[],
- int len, const ValLoc locs[]);
#endif /*HIDRAWCONV_H*/