Skip to content

Instantly share code, notes, and snippets.

@half2me
Last active February 15, 2024 12:13
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 half2me/dbc0eaee491c52b968090fbbb832bab0 to your computer and use it in GitHub Desktop.
Save half2me/dbc0eaee491c52b968090fbbb832bab0 to your computer and use it in GitHub Desktop.
Wireshark Plugin ANT+ Dissector
-- requires https://github.com/Snaipe/wssdl/releases/download/v0.2.0/wssdl.lua
local wssdl = require 'wssdl'
ant_msg = wssdl.packet {
sync:u8():hex(),
length:u8(),
class:u8():hex(),
payload:payload({ class, 'antplus.class' }, length * 8),
checksum:u8():hex()
}
ant_broadcast_event = wssdl.packet {
channel:u8(),
payload:bytes(8),
extendedFlag:u8():hex(),
deviceNumber:u16():le(),
deviceType:u8():hex(),
transmissionType:u8():hex(),
--rssiMeasurementType:u8():hex(),
--rssi:u8(),
--rssiThreshold:u8(),
--rxTimestamp:u16():le(),
}
ant_power_msg = wssdl.packet {
page:u8(),
eventCount:u8(),
unknown:u8(),
instantaneousCadence:u8(),
accumulatedPower:u16(),
instantaneousPower:u16(),
}
wssdl.dissect {
usb.bulk:add {
[0xFFFF] = ant_msg:proto('antplus', 'ANT+ Protocol')
},
antplus.class:add {
[0x4E] = ant_broadcast_event:proto('antplus_broadcast_event', 'ANT+ Broadcast Event')
},
--antplus_broadcast_event.deviceType:add {
-- [0x0B] = ant_power_msg:proto('antplus_power_meter', 'ANT+ Power Meter')
--},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment