Jack
2011/5/10 JP <j...@avagotech.com>:
> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>
{ "/dev/ttyS0", 0666, AID_RADIO, AID_RADIO, 0 },
[]'s
Hamilton Vera
--
Hamilton Vera
int Administrator (char Network[],char ComputationalSystems[])
http://hvera.wordpress.com
First of all
>>> > From adb shell:
>>> > $chown system.radio /dev/ttyS0
>>> > enables RIL services and can make phone calls.
>>> >
>>> > Similar entry in init.rc :
>>> > chown system radio /dev/ttyS0
>>> > does not enable RIL services:
Did you check the owner ship of /dev/ttyS0 again after you set it in
the init.rc and restarted? Was it the correct value still?
Secondly
According to your log, there should be 2 problems:
1.
I/RILC ( 986): RIL Daemon version: android reference-ril 1.0
I/RILJ ( 1145): Connected to 'rild' socket
D/RILJ ( 1145): [UNSL]< UNSOL_RESPONSE_RADIO_STATE_CHANGED RADIO_UNAVAILABLE
The last line above indicates that RIL.java has created the socket to
RIL daemon and received the first Unsolicited command from the daemon
to ask RIL.java to reset the Radio Power to be off. So in the next
normal step, the RIL.java should call
private void setRadioStateFromRILInt(int state) {
...
if (mInitialRadioStateChange) {
mInitialRadioStateChange = false;
if (newState.isOn()) {
/* If this is our first notification, make sure the radio
* is powered off. This gets the radio into a known state,
* since it's possible for the phone proc to have restarted
* (eg, if it or the runtime crashed) without the RIL
* and/or radio knowing.
*/
if (DBG) Log.d(LOG_TAG, "Radio ON @ init; reset to OFF");
setRadioPower(false, null);
return;
}
}
...
}
By default in froyo (android 2.2 or eclair 2.1), both the DBG and the
mInitialRadioStateChange should be true at that time. So there is
supposed to be the log as below:
D/RILJ (..): Radio ON @ init; reset to OFF
after the last line of the above 3.
I am not sure why this log is missing in yours and neither do I check
the 2.3 code. So maybe you have to check that part.
2.
I/RIL ( 986): Opening tty device /dev/ttyS0
According the line, the RIL daemon is trying to open ttyS0 as to
connect to the GSM modem. If it is successfully opened, it should do
the AT handshake subsequently and there should be the log info as
"AT>...". So maybe you have to either add more log info in reference-ril.c
static void *
mainLoop(void *param)
{
...
} else if (s_device_path != NULL) {
fd = open (s_device_path, O_RDWR);
if ( fd >= 0 && !memcmp( s_device_path, "/dev/ttyS", 9 ) ) {
/* disable echo on serial ports */
struct termios ios;
tcgetattr( fd, &ios );
ios.c_lflag = 0; /* disable ECHO, ICANON, etc... */
if( cfsetispeed( &ios, B115200) != 0 )
printf("Failed to set in speed\n");
if ( cfsetospeed( &ios, B115200) != 0 )
printf("Failed to set out speed\n");
tcsetattr( fd, TCSANOW, &ios );
}
}
////////////////// add here!
// log the the fd and the "errno" if fd < 0
// LOGI("Opened tty device %d, errno=%d", fd, errno);
//////////////////
if (fd < 0) {
perror ("opening AT interface. retrying...");
sleep(10);
/* never returns */
}
...
}
or make sure the atchannel.c can out put the related "AT>" log.
Jack
2011/5/11 jehangir parvereshi <jehangir....@avagotech.com>: