[maemo-developers] getting operator name and SIM card status on N900

From: Cláudio Sampaio patola at gmail.com
Date: Sat Apr 24 03:18:56 EEST 2010
On Fri, Apr 23, 2010 at 5:35 PM, William Maddler <news at maddler.net> wrote:

> Hello all,
> I've tried googling around but got no luck.
> I'd need to get current operator name a SIM card status (registered/not
> registered).
> Any clue or starting point? C or Python would be fine.

You can get them via dbus. First you get the operator code and country code,
then you get the proper string. In shell script:

opcountry=$(dbus-send --system --print-reply=literal --dest=
com.nokia.phone.net /com/nokia/phone/net \
Phone.Net.get_registration_status | tr '\n' ' ' | awk '{print $8,$10}')
opcode=$(echo $opcountry | cut -f1 -d' ')
countrycode=$(echo $opcountry | cut -f2 -d' ')
dbus-send --system --print-reply
--dest=com.nokia.phone.net/com/nokia/phone/net \
Phone.Net.get_operator_name byte:0 uint32:$opcode uint32:$countrycode | grep
string \
| awk '{print $2}' | tr -d \"

Cláudio "Patola" Sampaio
IRC: ptl  - Yahoo: patolaaa
Campinas, SP - Brazil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20100423/0b065d00/attachment.htm>
More information about the maemo-developers mailing list