I'd like to get the current export state (output / input) of a GPIO pin on a RaspberryPi using JavaScript.
Due to the fact that I've a low-active relay, which is activated in the second I export out a GPIO-pin, I need to be able to specific control the export states.
The idea is, that when I export out a GPIO pin using the pi-gpio library:
gpio.open(17, "output", function(err) {
// do something...
}
and some other functions / applications are working too, the GPIO pin could be in any state (exported in / out).
Does anyone know how to check the export state of a GPIO pin, in order to determine whether it is currently in output mode or input mode?