On 04/24/2010 02:18 AM, Cláudio Sampaio wrote:
> On Fri, Apr 23, 2010 at 5:35 PM, William Maddler <n...@maddler.net
> <mailto:n...@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.


_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to