1

So I have a need to force an android phone to register/de-register itself repeatedly. I'm accomplishing this via AT commands while the phone is in modem/diag mode over a USB serial connection. I check the current registration state via +CGREG and then assuming it's registered I kill the RF with +CFUN, check again, then turn the RF back on and allow the phone to search out and re-register itself normally. I issue the +CGREG command every few seconds to check on the status and once it's re-registered I repeat.

Now, sometimes I'll do this once or twice, sometimes it'll go five times and then the phone will decide to restart itself... it's a little frustrating and not the desired result.

Anyone have any ideas why the phone would reboot without command due to what I'm doing here? The phone will operate normally any number of hours while I'm not running these tests.

Psudo-Process:
while(true)
AT+CGREG? // starting state < usually registered>
AT+CFUN=4,0 // turn off RF
AT+CGREG? // verify it's not registered
AT+CFUN=1,0 // turn RF back on
while ( )
AT+CGREG? // check registration state every 2 seconds
end
end

On a side note: +COPS is a better option here, however the phone doesn't [fully] support it. The phone is an HTC Thunderbolt.

Hugo Dozois
  • 8,147
  • 12
  • 54
  • 58
Stolorg
  • 11
  • 4
  • I have a question out of interest for you, it might be trivial, How do you manage to communicate with the phone on AT commands i.e. Is there a special software involved involved ? I would be grateful for your guidance. – R.daneel.olivaw Feb 10 '12 at 14:58
  • 1
    I use the javax.comm package and have a small java program that connects over the "serial" port that is opened when the phone is in DIAG/MODEM mode. javax.comm has methods that will attach to the serial port and allow input/output streams. I'd just google the package and a javax.comm tutorial on connecting. It's what I did. – Stolorg Feb 10 '12 at 15:04

0 Answers0