peterschwarz/clj-firmata — pull request #3 by blakejakopovic (2014-07-29 09:16:20+00:00)
Title: Support extending read-sysex-event

I've had a play around with extending the `read-sysex-event` multi-method and it works great. I found that I also needed access to the following methods `consume-sysex` and `read-two-byte-data`. I don't know how you feel about making them public as well.

You can take a look at what I was working on (modifying clj-firmata only by making the above functions public) https://gist.github.com/blakejakopovic/78bef7a8abd8fb68a5ca.

The multi-methods automatically hook in once you `(require [testdrive.sysex])`, which is nice. It does seem a little hackish, and I haven't seen extending multi-methods in dependencies before. I guess an alternative implementation would to be have some kind of register/deregister sysex function. But it's also important to keep in mind that the Firmata protocol reserves space for 16 custom user commands (0x00-0x1F), so using multi-methods should be ok.

I'm happy to submit a pull-request (code and extending docs) if you're happy with the above changes.