Active Topics

 


Reply
Thread Tools
Posts: 28 | Thanked: 7 times | Joined on Jan 2010
#1
I used to use an application in N73 that let you change profiles based on which GSM cell you're in, or entering, or leaving.

Just trying to find something similar.

Changing profiles from a script is no problem in maemo 5. How do i get current cell number though? Any ideas?

Or if there is an app that meets the real requirement that's even better.

Thanks.
 
skalogre's Avatar
Posts: 327 | Thanked: 249 times | Joined on Sep 2009 @ Λεμεσιανός, ρε!
#2
Hmm... Alarmed can change on time but not on calendar entries or cell ID like Smartprofiles, Best Profiles, et.c.
I don't know if anything like this is in the pipeline... I don't see why it wouldn't be possible though.

Last edited by skalogre; 2010-06-25 at 18:37.
 
Posts: 156 | Thanked: 90 times | Joined on Jan 2010
#3
 
Posts: 28 | Thanked: 7 times | Joined on Jan 2010
#4
Originally Posted by rooted View Post
It's very possible with shell scripting. Cell id can be obtained with a certain dbus call (see phone control wiki page).
Thanks for pointing to the page. It's useful for lots of other things. However I couldn't find any related dbus method call or any other signal in there. Only thing that seemed related I saw was:

http://wiki.maemo.org/Phone_control#...tration_status

As this one outputs few bytes of data. Any more information?

Any specific dbus method I need to call or any other signal to send to device?

Lastly, is there an api-doc of some sort with a list of dbus methods with some intro/description?
 
Posts: 162 | Thanked: 351 times | Joined on Apr 2006 @ Cotswolds, UK
#5
get_registration_status is the right operation. You want to combine the four parameters LAC, cell id, operator code and country code to define the cell. These are the second, third, fourth and fifth response arguments.

Here is how you get them in a shell script:

Code:
reg=`dbus-send --system --print-reply=literal --type=method_call \
  --dest=com.nokia.phone.net /com/nokia/phone/net \
  Phone.Net.get_registration_status`

lac=`echo $reg | cut -f 4 -d " "`
cell_id=`echo $reg | cut -f 6 -d " "`
operator_code=`echo $reg | cut -f 8 -d " "`
country_code=`echo $reg | cut -f 10 -d " "`
 
Posts: 89 | Thanked: 52 times | Joined on Jan 2010 @ London, UK
#6
This is really useful. I am trying to do the same thing (if Shepherd ever gets properly released and workable then I'll be able to use that instead, but not holding out much hope).

But I don't want to poll dbus every few second/minute or two to find out if its changed; using the location api lib means maybe an online lookup for assisted cell-id-location or use of gps. I don't care about keeping the location of certain cell's cached, 'cos I'm happy to manually associate my regular few (work, home basically) with the right code to run my actions I want at certain times.

Do you know what the signal emitted is every time the cell id changes, if there is one - or a more trigger-based action rather than polling it if there's an alternative to dbus?

Or alternatively, am I being too dismissive of the location api (I only briefly skimmed some of the wiki info on it)? Is it possible to use it without relying on cached cell id locations that might fail if cache expires/cannot be downloaded/could return just somewhere in the middle of the country if it only knows I'm in the UK, for instance?

Last edited by jgbreezer; 2011-04-08 at 11:37.
 
spag's Avatar
Posts: 121 | Thanked: 275 times | Joined on Oct 2009 @ Blackhawk Island
#7
Originally Posted by jgbreezer View Post
Do you know what the signal emitted is every time the cell id changes, if there is one - or a more trigger-based action rather than polling it if there's an alternative to dbus?
Here some signals copypasted from NetMon. Maybe this helps you somewhat:
Code:
      bus.add_signal_receiver(signal_registration_status_change, dbus_interface = "Phone.Net", signal_name = "registration_status_change")           
                bus.add_signal_receiver(signal_signal_strength_change, dbus_interface = "Phone.Net", signal_name = "signal_strength_change")                   
                bus.add_signal_receiver(signal_network_time_info_change, dbus_interface = "Phone.Net", signal_name = "network_time_info_change")               
                bus.add_signal_receiver(signal_cellular_system_state_change, dbus_interface = "Phone.Net", signal_name = "cellular_system_state_change")       
                bus.add_signal_receiver(signal_radio_access_technology_change, dbus_interface = "Phone.Net", signal_name = "radio_access_technology_change")   
                bus.add_signal_receiver(signal_radio_info_change, dbus_interface = "Phone.Net", signal_name = "radio_info_change")                             
                bus.add_signal_receiver(signal_cell_info_change, dbus_interface = "Phone.Net", signal_name = "cell_info_change")                               
                bus.add_signal_receiver(signal_operator_name_change, dbus_interface = "Phone.Net", signal_name = "operator_name_change")
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:28.