Posts: 631 | Thanked: 837 times | Joined on May 2007 @ Milton, Ontario, Canada
#1
I'm sure I'm missing something here but I just can't for the life of me figure it out. I'm trying to use Dbus-send to control the native Presence settings on Diablo.
Background: the problem I'm running into is that I've got the tablet set to auto-associate with any of the known access points that it finds, but only some of them actually have internet connectivity (i.e. the one in my Jeep, for example, is just a local AP that I connect and use for managing the media player on, not for internet access). I've also got the Presence accounts for my SIP and MSN connections setup to auto connect whenever Wifi activates. However, when the tablet associates with an AP that doesn't actually have internet access, the Presence system just continuously tries to connect... over, and over, and over... leading to a much faster drop in battery life than if it just GAVE UP. Anyways, so the idea is to write a script that will be called by dbus-scripts to check which AP profile the tablet has just associated with, and if it's one that doesn't have internet connectivity than to manually disconnect the Presence accounts. I've read all kinds of documentaiton about Telepathy, Mission Control, DBus, etc and have come up with:

dbus-send --system --print-reply --type=method_call --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresen ce string:"offline"

but unfortunately it doesn't actually do anything, and I'm thinking I've gone wrong somewhere as I can't seem to get any kind of response from a GetPresence call, or anything else from Mission Control. So, am I completely wrong here, or? Any ideas?

Reference documentation I've been to thus far:
http://www.manpagez.com/man/1/dbus-send/

http://maemo.org/development/documen...managers_bora/

http://telepathy.freedesktop.org/wiki/Mission%20Control

http://telepathy.freedesktop.org/spec.html

Any ideas/thoughts/help is greatly appreciated!

Thanks,
-Rob
 

The Following User Says Thank You to jolouis For This Useful Post:
Posts: 3 | Thanked: 8 times | Joined on Apr 2007 @ Odense, Denmark
#2
Hi;

This works:
Code:
/usr/bin/dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresence uint32:<number> string:"<status-msg>"
Where <number> is one of:
1: offline
2: online
3: away
4: extended away
5: invisible
6: Do not Disturb


So fx if you want to go online with the status message of "I'm here":

Code:
/usr/bin/dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresence uint32:2 string:"I'm here"

Hope this helps.


/Per Wille
 

The Following 8 Users Say Thank You to wille For This Useful Post:
Posts: 631 | Thanked: 837 times | Joined on May 2007 @ Milton, Ontario, Canada
#3
Thanks Willie! I knew there was some silly little thing I was missing! I'd seen in the source of a few places that there were some constants being used to represent the various status states, but the documentation I read kept saying they were string values not integers... obviously I was mis-reading or mis-interpreting somewhere! Anyways, exactly what I was after, thanks!

-Rob
 
Posts: 105 | Thanked: 62 times | Joined on Aug 2009 @ Finland
#4
Originally Posted by wille View Post
Hi;

This works:
Code:
/usr/bin/dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresence uint32:<number> string:"<status-msg>"
Where <number> is one of:
1: offline
2: online
3: away
4: extended away
5: invisible
6: Do not Disturb


So fx if you want to go online with the status message of "I'm here":

Code:
/usr/bin/dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.MissionControl /org/freedesktop/Telepathy/MissionControl org.freedesktop.Telepathy.MissionControl.SetPresence uint32:2 string:"I'm here"

Hope this helps.


/Per Wille
Any tips on how to do this in maemo 5, the above method does not seem to work.

Some background information: I am trying to implement somekind of autoaway kludge for jabber/xmpp presence since Maemo 5 will not support it
 
Posts: 729 | Thanked: 155 times | Joined on Dec 2009
#5
I would like to change the status of the accounts when on WiFi so I am looking for D-BUS method but this one doesn't work with Fremantle. Does anyone know a working solution?
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 19:36.