Rearrange the order of declarations in the protocol.h header. Start with
packet layout, continue with requests (commands), then responses (status),
before the device context and the set of routines.
Rename the status codes to STS_* in contrast to CMD_* codes. Use an enum
for different byte values, leave defines for packet sizes et al. Phrase
bit fields in terms of bit numbers not byte values.
Total nit: Change the breaks in the long list of add_source() args. Keep
event type and timeout together, similar to callback and its data.