anne-key icon indicating copy to clipboard operation
anne-key copied to clipboard

protocol: parse MsgType using scroll

Open hdhoang opened this issue 7 years ago • 4 comments

As a PoC it only parses one byte. Next up would be buffer.pread::<Message>(0), but I haven't cooked up a multiplexing try_from_ctx for the different MsgType + XOp yet.

Further, we could have buffer.pwrite::<LedTheme> for sending the 0xca set-LED messages too.

cc #20

hdhoang avatar May 17 '18 05:05 hdhoang

proc-macro2 will be compatible with the new nightlies soon dtolnay/quote#73

hdhoang avatar May 17 '18 09:05 hdhoang

Oh that's really nice, I had been looking for a lib that does exactly this but hadn't tried out scroll yet. This is looking really promising, especially that it does proper parsing rather than just casting and hoping it all works.

ah- avatar May 17 '18 22:05 ah-

I'd like to make some round-trip tests to run on x86-64 too.

hdhoang avatar May 18 '18 05:05 hdhoang

The test target hard-codes linux-gnu though, I will try to extract rustup target list|grep default | cut -d ' ' -f 1 into make somehow.

hdhoang avatar May 18 '18 10:05 hdhoang