Subject: | Could you add a function to find out which network the device is connected to? |
Hello,
I would like a function that reads the name of the network that the
device is connected to. Currently I use the following code:
#...snip the usual initialization
$gsm->atsend('AT+COPS?'.Device::Modem::CR);
my $foo = $gsm->answer();
$foo =~ /\"(.*)\"/;
my $center = $1;
print "$center\n";
The raw answer to the AT+COPS? query is, in my test,
+COPS: 1,0,"TDC Mobil"
OK
from which my regexp isolates the string 'TDC Mobil'
-it would also be nice with a function that returns the name of the
individual cell. I've looked into it, and can see that it can be enabled
by issuing the command 'AT+CREG=2' and then queried by 'AT+CREG?'. This
returns a couple of things, such as cell ID.
However, this Cell ID is a hexidecimal code, which apparently
corresponds to a data entry on the SIM card which has the name of the
cell stored as a string. So far I haven't been able to find out how to
extract this from the SIM card. (As far as I can figure out, the cell
ids are regularly broadcast on the network, so the SIM card receives
this automatically)
I suggest that a function which can return the status of the connection
is added to the module;
AT+CREG in mode 0 does this. If it's queried, it returns <mode>,<state>
where <state> can be
(0,1,2,3,4,5) = (not registered, registered, trying to find operator,
registration denied, unknown, registered and roaming)
Sorry about the poor structure of the post. I just wanted to write down
a couple of thoughts. :-p
Cheers.