Can android NDK open uart port without root?

75 views
Skip to first unread message

jason

unread,
Jan 14, 2016, 11:28:14 AM1/14/16
to android-ndk

Hi,


I have a problem.

My app uses Android NDK to open uart port.


the NDK code is :

fd = open("/dev/ttys1", O_RDWR | O_NOCTTY | O_NONBLOCK);

but fd will return -1


I check /dev/ttyS1 permission is : crw-rw-----

If I use root to chmod 666 /dev/ttyS1

fd will return > 0 , and uart port can be opened


Can I use Android NDK to open uart port without root to chmod ?


Thanks~

Glenn Kasten

unread,
Jan 15, 2016, 12:03:16 PM1/15/16
to android-ndk
NDK does not provide any different permissions than SDK.
Reply all
Reply to author
Forward
0 new messages