Permission denied for ttyACM0 Port in nexus 5

守給你的承諾、 提交于 2019-12-13 04:27:18

问题


I am trying to connect external GSM modem with nexus 5 and send AT command using android RIL layer.I am using android 5.0 AOSP for nexus 5 downloaded from Google source.

Error: Permission denied with trying to open ttyACM0 port. i have checked this by changing permissions but still permission denied error.

Does there any other permissions do i have to change to open port?


回答1:


You are getting permission denied because the Android RIL doesn't have the appropriate selinux(Security Enhanced Linux) permissions for that device. As the RIL already has rw permissions to the files in the radio_device context as shown below and in this link.

allow rild radio_device:chr_file rw_file_perms;

So, just change the context of your device file to radio_device so that the RIL has the appropriate permissions to access it by adding the line below to file YOUR_BUILD_DIRECTORY/external/sepolicy/file_context and hopefully it should work.

/dev/ttyACM0        u:object_r:radio_device:s0


来源:https://stackoverflow.com/questions/29844577/permission-denied-for-ttyacm0-port-in-nexus-5

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!