Skip to content

generalize blink1-lib interface with blink1raw-lib backend #1

Open
wants to merge 11 commits into from

2 participants

@dylex
dylex commented Dec 6, 2012

This allows some programs using blink1-lib to use the hidraw backend without the need for libusb. I plan to add more functionality to the blink1raw-lib interface in the future, but this was enough to build blink1raw against. So far this is not tested because I don't have my blink(1) yet, but it at least builds.

There are other ways of doing this and this is just a quick hack, but it would be nice if the blink1-lib code that knows how to generate the commands and only depends on a read() and write() interface were independent of the particular libusb backend, so that it could be used in other situations.

dylex added some commits Dec 7, 2012
@dylex dylex Fix incorrect time value "dms % 0xFF"
The time is meant to be split into separate bytes, so these should be "dms &
0xFF" or "dms % 0x100".
a85cfdd
@dylex dylex Fix blink1raw help message.
Had stray comma and unescaped percent.  Use fputs instead since it's a fixed
string.
66b1adf
@dylex dylex Add comment about broken blink1_serialnumread 7de74fe
@dylex dylex generalize blink1-lib interface with blink1-common and add compatible…
… blink1raw-lib, which blink1raw now uses

This allows some programs using blink1-lib to use the hidraw backend without
the need for libusb.  I plan to add more functionality to the blink1raw-lib
interface.  So far this is not tested because I don't have my blink(1) yet, but
it at least builds.
78dfb59
@dylex dylex switch blink1raw to blink1-common interface 8041f98
@dylex
dylex commented Dec 7, 2012

The first few commits also include some simple fixes of obviously incorrect code, including "dms % 0xFF".

@dylex dylex blink1raw: simple implementation of blink1_open
Uses /sys/bus/hid/devices to find first matching hidraw device in /dev.
7f90faa
@todbot
Owner
todbot commented Dec 7, 2012

This looks really great, thanks! I'll need to see how (if at all) this impacts all the downstream users and archs of blink1-lib, and I won't be able to get to that until late December I think.

@ellson ellson referenced this pull request Jan 9, 2015
Open

Kernel crash on Linux #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.