Skip Menu |

This queue is for tickets about the Device-Gsm CPAN distribution.

Report information
The Basics
Id: 23575
Status: resolved
Worked: 3 hours (180 min)
Priority: 0/
Queue: Device-Gsm

People
Owner: cosimo [...] cpan.org
Requestors: dellr [...] mac.nospam.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.45
Fixed in: (no value)



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.
Your thoughts are very interesting. Thanks for sharing. I will certainly add these features. I should only test the compatibility of these commands with the Nokia 6600 I have. Probably a week should be enough to do that.
The network() method to Device::Gsm class has been tested and added. For the cell ids, I need some more digging, therefore I will address that in a next release of Device::Gsm. The new version that contains the network() method is going to be uploaded to CPAN in a day or two. Please have patience. It will be tagged as Device::Gsm v1.46.