Public feed #725395

Anonymous

public text v1 · immutable
Raw Edit
·published 2007-10-04 11:35 UTC
rendered paste body
*** /home/jra/kamikaze/build_dir/mipsel/gnokii-0.6.18/gnokii/gnokii-other.c    2007-07-24 22:31:36.000000000 +0200
--- gnokii/gnokii-other.c       2007-10-04 13:31:40.000000000 +0200
***************
*** 180,185 ****
--- 180,186 ----
        char country[4] = {0, 0, 0, 0};
  
        gn_data_clear(data);
+       memset(&networkinfo, 0, sizeof(gn_network_info));
        data->network_info = &networkinfo;
  
        if ((error = gn_sm_functions(GN_OP_GetNetworkInfo, data, state)) != GN_ERR_NONE) {
*** /home/jra/kamikaze/build_dir/mipsel/gnokii-0.6.18/common/phones/atsoer.c   2007-07-24 22:31:35.000000000 +0200
--- common/phones/atsoer.c      2007-10-04 13:13:02.000000000 +0200
***************
*** 202,207 ****
--- 202,220 ----
        return sm_block_no_retry(GN_OP_DeletePhonebook, data, state);
  }
  
+ static gn_error AT_WriteGetNet(gn_data *data, struct gn_statemachine *state)
+ {
+       gn_error error;
+       if (!data->network_info)
+               return GN_ERR_INTERNALERROR;
+ 
+       /* Sony Ericsson phones can't do CREG=2 (only CREG=1), so just
+        * skip that and only do COPS */
+ 
+       if (sm_message_send(9, GN_OP_GetNetworkInfo, "AT+COPS?\r", state))
+               return GN_ERR_NOTREADY;
+       return sm_block_no_retry(GN_OP_GetNetworkInfo, data, state);
+ }
  
  void at_sonyericsson_init(char* foundmodel, char* setupmodel, struct gn_statemachine *state)
  {
***************
*** 209,212 ****
--- 222,226 ----
        at_insert_recv_function(GN_OP_ReadPhonebook, ReplyReadPhonebook, state);
        at_insert_send_function(GN_OP_WritePhonebook, AT_WritePhonebook, state);
        at_insert_send_function(GN_OP_DeletePhonebook, AT_DeletePhonebook, state);
+       at_insert_send_function(GN_OP_GetNetworkInfo, AT_WriteGetNet, state);
  }