Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CDMA+GSM RhodiumW RIL changes
- diff --git a/htcgeneric-ril.c b/htcgeneric-ril.c
- index 8e63fba..62a3beb 100644
- --- a/htcgeneric-ril.c
- +++ b/htcgeneric-ril.c
- @@ -325,7 +325,7 @@ static void onSIMReady()
- /* Common initialization commands */
- /* Network registration */
- - at_send_command("AT+COPS=0", NULL);
- +// at_send_command("AT+COPS=0", NULL);
- if(isgsm) {
- /* Preferred RAT - UMTS Dualmode */
- @@ -381,10 +381,10 @@ static void requestRadioPower(void *data, size_t datalen, RIL_Token t)
- onOff = ((int *)data)[0];
- if (onOff == 0 && sState != RADIO_STATE_OFF) {
- - if(isgsm)
- + //if(isgsm)
- err = at_send_command("AT+CFUN=0", &p_response);
- - else
- - err = at_send_command("AT+CFUN=66", &p_response);
- + //else
- + // err = at_send_command("AT+CFUN=66", &p_response);
- if (err < 0 || p_response->success == 0) goto error;
- setRadioState(RADIO_STATE_OFF);
- } else if (onOff > 0 && sState == RADIO_STATE_OFF) {
- @@ -1410,7 +1410,7 @@ static void requestRegistrationState(int request, void *data,
- goto error;
- }
- } else {
- - cmd = "AT+COPS?";
- + cmd = "AT+HTC_SRV_STATUS?";
- prefix= "$HTC_SYSTYPE";
- }
- err = 1;
- @@ -3021,6 +3021,7 @@ static void requestGetIMSI(RIL_Token t)
- goto error;
- imsi = strdup(p_response->p_intermediates->line);
- } else {
- +#if 0
- err = at_send_command_singleline("AT+COPS?", "+COPS:", &p_response);
- if (err < 0 || p_response->success == 0)
- @@ -3039,8 +3040,10 @@ static void requestGetIMSI(RIL_Token t)
- goto error;
- part = strdup(response);
- + free (part);
- at_response_free(p_response);
- +#endif
- err = at_send_command_singleline("AT+CNUM", "+CNUM:", &p_response);
- @@ -3058,7 +3061,6 @@ static void requestGetIMSI(RIL_Token t)
- //FIXME make it work with the real IMSI: asprintf(&imsi, "%s%s", part, response); //Real opID
- asprintf(&imsi, "310995000000000"); //Fake opID
- - free (part);
- }
- RIL_onRequestComplete(t, RIL_E_SUCCESS, imsi, sizeof(char *));
- @@ -3074,15 +3076,15 @@ static void requestGetIMEISV(RIL_Token t)
- {
- int err = 0;
- ATResponse *p_response = NULL;
- - if(isgsm) {
- - err = at_send_command_numeric("AT+CGSN", &p_response);
- + //if(isgsm) {
- + err = at_send_command_numeric("AT+GSN", &p_response);
- if (err < 0 || p_response->success == 0) {
- RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
- } else {
- RIL_onRequestComplete(t, RIL_E_SUCCESS,
- p_response->p_intermediates->line, sizeof(char *));
- }
- - } else {
- + /*} else {
- char * line;
- unsigned long int imei;
- char * imeiString;
- @@ -3101,6 +3103,7 @@ static void requestGetIMEISV(RIL_Token t)
- }
- }
- + */
- at_response_free(p_response);
- return;
- }
- @@ -4143,10 +4146,10 @@ static void initializeCallback(void *param)
- at_handshake();
- /* make sure the radio is off */
- - if(isgsm)
- +// if(isgsm)
- at_send_command("AT+CFUN=0", NULL);
- - else
- - at_send_command("AT+CFUN=66", NULL);
- +// else
- +// at_send_command("AT+CFUN=66", NULL);
- setRadioState (RADIO_STATE_OFF);
- @@ -4263,6 +4266,12 @@ static void initializeCallback(void *param)
- }
- + else
- + {
- + at_send_command("ATH", NULL);
- + at_send_command("AT+CGAATT=2,1,6", NULL);
- + at_send_command("AT+COPS=0", NULL);
- + }
- /* assume radio is off on error */
- if (isRadioOn() > 0) {
- setRadioState (RADIO_STATE_SIM_NOT_READY);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement