Advertisement
Guest User

MrPippy

a guest
Mar 27th, 2010
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. CDMA+GSM RhodiumW RIL changes
  2.  
  3. diff --git a/htcgeneric-ril.c b/htcgeneric-ril.c
  4. index 8e63fba..62a3beb 100644
  5. --- a/htcgeneric-ril.c
  6. +++ b/htcgeneric-ril.c
  7. @@ -325,7 +325,7 @@ static void onSIMReady()
  8. /* Common initialization commands */
  9.  
  10. /* Network registration */
  11. - at_send_command("AT+COPS=0", NULL);
  12. +// at_send_command("AT+COPS=0", NULL);
  13.  
  14. if(isgsm) {
  15. /* Preferred RAT - UMTS Dualmode */
  16. @@ -381,10 +381,10 @@ static void requestRadioPower(void *data, size_t datalen, RIL_Token t)
  17. onOff = ((int *)data)[0];
  18.  
  19. if (onOff == 0 && sState != RADIO_STATE_OFF) {
  20. - if(isgsm)
  21. + //if(isgsm)
  22. err = at_send_command("AT+CFUN=0", &p_response);
  23. - else
  24. - err = at_send_command("AT+CFUN=66", &p_response);
  25. + //else
  26. + // err = at_send_command("AT+CFUN=66", &p_response);
  27. if (err < 0 || p_response->success == 0) goto error;
  28. setRadioState(RADIO_STATE_OFF);
  29. } else if (onOff > 0 && sState == RADIO_STATE_OFF) {
  30. @@ -1410,7 +1410,7 @@ static void requestRegistrationState(int request, void *data,
  31. goto error;
  32. }
  33. } else {
  34. - cmd = "AT+COPS?";
  35. + cmd = "AT+HTC_SRV_STATUS?";
  36. prefix= "$HTC_SYSTYPE";
  37. }
  38. err = 1;
  39. @@ -3021,6 +3021,7 @@ static void requestGetIMSI(RIL_Token t)
  40. goto error;
  41. imsi = strdup(p_response->p_intermediates->line);
  42. } else {
  43. +#if 0
  44. err = at_send_command_singleline("AT+COPS?", "+COPS:", &p_response);
  45.  
  46. if (err < 0 || p_response->success == 0)
  47. @@ -3039,8 +3040,10 @@ static void requestGetIMSI(RIL_Token t)
  48. goto error;
  49.  
  50. part = strdup(response);
  51. + free (part);
  52.  
  53. at_response_free(p_response);
  54. +#endif
  55.  
  56. err = at_send_command_singleline("AT+CNUM", "+CNUM:", &p_response);
  57.  
  58. @@ -3058,7 +3061,6 @@ static void requestGetIMSI(RIL_Token t)
  59. //FIXME make it work with the real IMSI: asprintf(&imsi, "%s%s", part, response); //Real opID
  60. asprintf(&imsi, "310995000000000"); //Fake opID
  61.  
  62. - free (part);
  63. }
  64.  
  65. RIL_onRequestComplete(t, RIL_E_SUCCESS, imsi, sizeof(char *));
  66. @@ -3074,15 +3076,15 @@ static void requestGetIMEISV(RIL_Token t)
  67. {
  68. int err = 0;
  69. ATResponse *p_response = NULL;
  70. - if(isgsm) {
  71. - err = at_send_command_numeric("AT+CGSN", &p_response);
  72. + //if(isgsm) {
  73. + err = at_send_command_numeric("AT+GSN", &p_response);
  74. if (err < 0 || p_response->success == 0) {
  75. RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
  76. } else {
  77. RIL_onRequestComplete(t, RIL_E_SUCCESS,
  78. p_response->p_intermediates->line, sizeof(char *));
  79. }
  80. - } else {
  81. + /*} else {
  82. char * line;
  83. unsigned long int imei;
  84. char * imeiString;
  85. @@ -3101,6 +3103,7 @@ static void requestGetIMEISV(RIL_Token t)
  86. }
  87.  
  88. }
  89. + */
  90. at_response_free(p_response);
  91. return;
  92. }
  93. @@ -4143,10 +4146,10 @@ static void initializeCallback(void *param)
  94. at_handshake();
  95.  
  96. /* make sure the radio is off */
  97. - if(isgsm)
  98. +// if(isgsm)
  99. at_send_command("AT+CFUN=0", NULL);
  100. - else
  101. - at_send_command("AT+CFUN=66", NULL);
  102. +// else
  103. +// at_send_command("AT+CFUN=66", NULL);
  104.  
  105.  
  106. setRadioState (RADIO_STATE_OFF);
  107. @@ -4263,6 +4266,12 @@ static void initializeCallback(void *param)
  108.  
  109.  
  110. }
  111. + else
  112. + {
  113. + at_send_command("ATH", NULL);
  114. + at_send_command("AT+CGAATT=2,1,6", NULL);
  115. + at_send_command("AT+COPS=0", NULL);
  116. + }
  117. /* assume radio is off on error */
  118. if (isRadioOn() > 0) {
  119. setRadioState (RADIO_STATE_SIM_NOT_READY);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement