GPIO Configuration Checking in jdk.dio
Jen Dority
jen.dority at oracle.com
Tue Jun 3 21:39:48 UTC 2014
Hi Sergey,
Sorry for the spam. I got the mailing list address wrong the first time. :)
I wanted to continue this discussion on the open mailing list since it's
finally up-and-running.
I did some testing on the raspberry pi with the GPIO pin "validation"
code removed from the native layer.
With this custom build, I then tried to open and write to each possible
GPIO pin from 0 to 27.
Of the 28 test cases, only 1 (GPIO16) caused an error to be reported
back from the OS calls -- although messing with GPIO6 did BAD THINGS and
is not recommended. This is far fewer errors than I expected.
Is this consistent with what you are seeing? Did you need to add more
error checking to gpio.c to rely on the gpio driver to keep users from
opening (and writing to) GPIO pins that weren't really available?
I understand what you're saying about it not being our code's place to
do this kind of checking, but it doesn't look like we get much of any
checking from the sysfs API.
Jen
More information about the dio-dev
mailing list