Last active
February 15, 2024 12:13
-
-
Save half2me/dbc0eaee491c52b968090fbbb832bab0 to your computer and use it in GitHub Desktop.
Revisions
-
half2me revised this gist
Feb 15, 2024 . 1 changed file with 31 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,44 @@ -- 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') --}, } -
half2me renamed this gist
Feb 15, 2024 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,16 @@ -- requires https://github.com/Snaipe/wssdl/releases/download/v0.2.0/wssdl.lua local wssdl = require 'wssdl' ant_pkt = wssdl.packet { sync:u8():hex(), length:u8(), class:u8():hex(), payload:payload({ class, 'antplus.class' }, length * 8), checksum:u8():hex() } proto = ant_pkt:proto('antplus', 'ANT+ Protocol') wssdl.dissect { usb.bulk:add { [0xFFFF] = proto } } -
half2me created this gist
Feb 14, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ local wssdl = require 'wssdl' ant_pkt = wssdl.packet { sync:u8():hex(), length:u8(), class:u8():hex(), payload:payload(class), checksum:u8():hex() } proto = ant_pkt:proto('antplus', 'ANT+ Protocol') wssdl.dissect { usb.bulk:add { [0xFF] = proto, [0xFFFF] = proto } }