[maemo-developers] getting operator name and SIM card status on N900
From: William Maddler news at maddler.netDate: Sat Apr 24 14:16:56 EEST 2010
- Previous message: getting operator name and SIM card status on N900
- Next message: getting operator name and SIM card status on N900
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 04/24/2010 02:18 AM, Cláudio Sampaio wrote: > On Fri, Apr 23, 2010 at 5:35 PM, William Maddler <news at maddler.net > <mailto: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: > > #!/bin/sh > opcountry=$(dbus-send --system --print-reply=literal > --dest=com.nokia.phone.net <http://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 > <http://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 \" Great!!! That's exactly what I needed! Thank you very much William > > -- > Cláudio "Patola" Sampaio > IRC: ptl - Yahoo: patolaaa > Campinas, SP - Brazil.
- Previous message: getting operator name and SIM card status on N900
- Next message: getting operator name and SIM card status on N900
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]