如何连接到RILD插座 [英] How to Connect to rild Socket

查看:185
本文介绍了如何连接到RILD插座的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个应用程序交谈的RILD。是的,我知道这不是政治正确,但它是一个嵌入式工业遥测应用程序,所以我不关心用户体验,便携性和所有的东西。

I'm trying to write an app to talk to the rild. And Yes, I know this is not politically correct, but it's an embedded industrial telemetry app so I'm not concerned about user experience, portability and all that stuff.

现在的问题是,当我尝试连接,我得到一个java.io权限被拒绝的异常。任何人可以帮助我吗?

The problem is that when I try to connect, I get a java.io "Permission denied" exception. Can anybody help me?

手机(Nexus One的)是根植与的CyanogenMod 7的应用程序是使用来自市场的超级用户的应用程序运行的超级用户。

The phone (Nexus One) is rooted with Cyanogenmod 7 and the app is running as superuser using the "SuperUser" app from Market.

我的code(略):

try {
  mSocket = new LocalSocket();
  mSockAddr = new LocalSocketAddress( "rild", LocalSocketAddress.Namespace.RESERVED );
  mSocket.connect( mSockAddr );
}
catch( Exception e ) {
  dbg.p( "connect failed: "+e );
}

我看到RILD(和RILD调试)中的/ dev /插座插孔。

I see the rild (and rild-debug) sockets in /dev/socket.

srw-rw----    1 root     radio            0 Feb 13 19:14 rild
srw-rw----    1 radio    system           0 Feb 13 19:14 rild-debug

难道是已经连接的拨号器应用程序,并占用插座?

Could it be that the Dialer app is already connected and hogging the socket?

顺便说一句我最初尝试使用框架,但得到的多是关于Java和与第三方类未知错误的humongus一大堆,所以我的头发拉天后放弃了。我也已经STFW和本网站 - 很多的解决此问题的舞蹈,但没有具体的建议

BTW I initially tried to use the frameworks but got a humongus boatload of errors mostly about java and and third party classes unknown, so I gave up after days of hair-pulling. I've also STFW and this site - lot's of dancing around the issue but no concrete advice.

任何帮助非常AP preciated。 约翰

Any help greatly appreciated. -John

推荐答案

在RILD插座的java的到底是的 com.android.internal.telephony.RIL.java 的一个实例,这是通过的 com.android.phone.PhoneApp.java 的拥有。 PhoneApp是一种持久性的应用程序当中,这并不奇怪,提供电话功能。而禁止PhoneApp应该杀死任何Java端使用RILD插座。

On the java end of the rild socket is an instance of com.android.internal.telephony.RIL.java, which is owned by com.android.phone.PhoneApp.java. PhoneApp is a persistent app which, not surprisingly, provides the phone functionality. Disabling PhoneApp should kill any java-side use of the rild socket.

您可能也想尝试连接到RILD调试,这是未使用(但可以通过在RIL守护程序被忽略)。

You also might want to try connecting to "rild-debug", which is unused (but may be ignored by the ril-daemon).

顺便说一句 - 你可以通过执行看到RIL层之间的通讯科的logcat -b广播

BTW - You can see the comms between the RIL layers by doing logcat -b radio.

请回来后,如果你拿出一个解决办法。

Please post back if you come up with a workaround.

这篇关于如何连接到RILD插座的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆