Skip to content

Instantly share code, notes, and snippets.

@tannewt
Created July 11, 2023 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tannewt/eac4d275a496dd151bd6a5ce8f27cfda to your computer and use it in GitHub Desktop.
Save tannewt/eac4d275a496dd151bd6a5ce8f27cfda to your computer and use it in GitHub Desktop.
Kaitai struct parsing for Intellikeys hid reports
meta:
id: intellikeys
file-extension: intellikeys
seq:
- id: reports
type: report
repeat: eos
types:
report:
seq:
- id: event_id
enum: event_type
type: u1
- id: data
size: 7
type:
switch-on: event_id
cases:
'event_type::sensor_change': sensor_change
'event_type::membrane_press': membrane_change
'event_type::membrane_release': membrane_change
'event_type::version': version
sensor_change:
seq:
- id: num
type: u1
- id: state
type: u1
- size: 5
membrane_change:
seq:
- id: x
type: u1
- id: y
type: u1
- size: 5
version:
seq:
- id: major
type: u1
- id: minor
type: u1
- size: 5
enums:
event_type:
51: ack
52: membrane_press
53: membrane_release
54: switch
55: sensor_change
56: version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment