10 #include <linux/types.h>
16 #define MAXREPORTLEN 256
17 #define MAXREPORTS 256
19 typedef struct { int len; uint8_t *msg; } Last;
20 typedef struct { Last lasts[MAXREPORTS]; } LastReports;
21 typedef void ProcessReport(const uint8_t *msg, int msglen, const uint8_t *last);
23 extern const char *const descriptor;
24 extern ProcessReport *const report_processors[MAXREPORTS];
26 void dispatch(LastReports *lasts, const char *message_prefix,
27 ProcessReport *const report_processors[MAXREPORTS],
28 const uint8_t *msg, int l);
30 /*---------- specific reporters ----------*/
32 /*----- "bits", ie keys and buttons -----*/
40 void reportbits(const uint8_t msg[], const uint8_t last[],
41 int len, const KeyBit keybits[]);
43 /*----- "vals", ie absolute values -----*/
47 int pos, rshift, sign; /* mask is applied before rshift */
51 void reportvals(const uint8_t msg[], const uint8_t last[],
52 int len, const ValLoc vallocs[]);
55 /*----- "hats", ie hatswitches -----*/
62 const char *str; /* base; reporter will append "X" and "Y" to this */
63 int pos, rshift, max; /* mask is applied before rshift */
68 void reporthats(const uint8_t msg[], const uint8_t last[],
69 int len, const HatLoc hatlocs[]);
71 #endif /*HIDRAWCONV_H*/