본문 바로가기

개발 개발/Android

ioctl shell command in system bin

$ ioctl -h 
ioctl -h 
ioctl [-l <length>] [-a <argsize>] [-rdh] <device> <ioctlnr> 
  -l <lenght>   Length of io buffer 
  -a <argsize>  Size of each argument (1-8) 
  -r            Open device in read only mode 
  -d            Direct argument (no iobuffer) 
  -h            Print help 


I tried on Tiny6410. Using ioctl one can turn on and off the leds


To turn on led3 
# ioctl  -d  /dev/leds 1 3
sending ioctl 0x1 0x03 0x00 0x00 0x00
return buf: 03 00 00 00

To tun off led3
 # ioctl  -d  /dev/leds 0 3
sending ioctl 0x0 0x03 0x00 0x00 0x00
return buf: 03 00 00 00

Hope this helps.