Hi sudheer, The error is bcoz rild is asking ril for a request it doesn't know how to handle. In the reference-ril.c or whatever your ril library file is, Look for the function "static void onRequest (int request, void *data, size_t datalen, RIL_Token t)" it will have a switch case statement with "request" as switch. In that give a case statement as below :-
case RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE: break; this will deal with your error. But it's purpose was to set 2G/3G preference. So if you are dealing with a 3G modem and really need this functionality then, in the case statement , give a function call. and define the get and set functions called previously to send and receive at commands which set 2G/3G network scan preference and get them back. IF you are using a 2G only modem then ignore. You say you have data connection working with chat scripts. So next step is to integrate the chat script into RIL by editing the requestSetupDataCall function in reference-ril.c with your chat script commands. This will allow you to use the APNs defined by user in settings to be used dynamically. You will still have to call pppd, but you doNOT need ti pass the * 'chat -v "" AT OK ATE0 OK AT+IPR=115200 OK AT+CGDCONT=1,\"IP\",\" airtelgprs.com\" OK ATDT*99***1# CONNECT' * part.The only difference is that with chat scripts you are stuck with one APN setting only. with RIL implementation you can edit it in settings in android. DO THIS ONLY AFTER EVERYTHING IN DATA CONNECTION IS WORKING. If not work with it first.bcoz editing it in RIL means recompiling ril where as editing chat script is very easy. Then trim the pppd command call by giving all options like /dev/ttyS0 115200 asyncmap auth connect in a seperate script file and give "pppd call scriptfile_name" or place options in /etc/ppp/options file and then you can simply call "pppd" with no options given. This will make it look neat. On Wed, Jan 18, 2012 at 7:45 PM, sudheer mudagond <mudag...@gmail.com>wrote: > HI All, > > I am working on porting gprs to android. I have gingerbread ported on > arm target. I have seen a very good discussions on porting gprs to android. > Also I am facing the problem in this. > I have successfully ported RIL to android and i am able to make > phone call and sms using my sim card on GSM + GPRS module integrated > on a TI ARM based EVK. > > Now i want configure the internet using Mobile network. If i go to > Settings->Wireless Networks->Mobile Networks->APN > > on logcat -b radio, i see following log message > [0081]< REQUEST_GET_PREFERRED_NETWORK_TYPE error: > com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED > > For my GSM+GPRS the pppd and chat command on linux to get the remote ip > and local ip is: > pppd /dev/ttyS0 115200 asyncmap auth connect 'chat -v "" AT OK ATE0 OK > AT+IPR=115200 OK AT+CGDCONT=1,\"IP\",\"airtelgprs.com\" OK ATDT*99***1# > CONNECT' nocrtscts defaultroute modem updetach > > I feel RIL module will also take care of Mobile network configuration in > case of Android. > > Please advice, if the RIL i have ported is minimal for Phone and SMS only > and need to be supported for Network as well, as the radio log message > dumps as > [0081]< REQUEST_GET_PREFERRED_NETWORK_TYPE error: > com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED > > Do i need to implemenet in RIL 'GET_PREFERRED_NETWORK_TYPE' and > 'SET_PREFERRED_NETWORK_TYPE'? or am i missing anything else as well, as i > see in setttings->security settings, my SIM LOCK is enabled by default, do > i have to unlock it? if so,it asks for a PIN as well. > > > Thanks and Regards > SUDHEER > > -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting