chiark / gitweb /
hostside: hidrawconv: break out dispatch()
[trains.git] / hostside / hidrawconv.h
index 5380a6c59b42c9c085c3e9ec2b4fc1ac83589416..2fdfdb2d43056c2d881f8550e73258d1146d5fa4 100644 (file)
@@ -9,6 +9,8 @@
 #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;
@@ -32,4 +34,8 @@ void reportbits(const uint8_t msg[], const uint8_t last[],
 void reportlocs(const uint8_t msg[], const uint8_t last[],
                int len, const ValLoc locs[]);
 
+void dispatch(LastReports *lasts, const char *message_prefix,
+             ProcessReport *const report_processors[MAXREPORTS],
+             const uint8_t *msg, int l);
+
 #endif /*HIDRAWCONV_H*/