Re: getting operator name and SIM card status on N900

2010-04-24 Thread William Maddler
On 04/23/2010 10:35 PM, William Maddler 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.

Answering to myself: http://wiki.maemo.org/Phone_control

Bye
William

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


Re: getting operator name and SIM card status on N900

2010-04-24 Thread William Maddler
On 04/24/2010 02:18 AM, Cláudio Sampaio wrote:
> On Fri, Apr 23, 2010 at 5:35 PM, William Maddler  > 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 
> /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 \"



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


Re: getting operator name and SIM card status on N900

2010-04-23 Thread Cláudio Sampaio
On Fri, Apr 23, 2010 at 5:35 PM, William Maddler  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 /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.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


getting operator name and SIM card status on N900

2010-04-23 Thread William Maddler
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.

Thank you
William

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