You can access the gpio functions from the shell by writing to members of this directory, e.g. set direction, set on/off.
In a normal linux system you can do the same thing by doing an open() and then write(). In a sandboxed application this results in permission problems, even when these members have been assigned in .cdef.
Has anyone been able to make this work in a sandboxed application? I’m aware of the le_gpio routines but I’m having some issues with them. Thanks.
Thanks for the reply. However it looks like it’s not possible to set SMACK rule on a gpio pseudo file:
root@swi-mdm9x28-wp:~# ls -l /sys/class/gpio/gpio23/direction
-rw-rw-rw- 1 root root 4096 Apr 30 09:28 /sys/class/gpio/gpio23/direction
root@swi-mdm9x28-wp:~# xattr set 'security.SMACK64' app.helloTestrwx /sys/class/gpio/gpio23/direction
root@swi-mdm9x28-wp:~# xattr get /sys/class/gpio/gpio23/direction
root@swi-mdm9x28-wp:~#
I have also tried defining the gpio pseudo file as a “file” or “device” in “requires”, I cannot open either way. “device” reports permission error, “file” reports not found.