Wops, forgot to attach the actual code :)<br><br><div class="gmail_quote">2010/8/8 Linus <span dir="ltr"><<a href="mailto:linus.wallgren@gmail.com">linus.wallgren@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I have been trying to change radio mode (to only use 2G/3G or both) via DBus as a part of shepherd, my gsoc project. It works wonders when I use dbus-send (taken from <a href="http://wiki.maemo.org/Phone_Control" target="_blank">wiki.maemo.org/Phone_Control</a>):<br>
<br>dbus-send --system --type=method_call --dest=<a href="http://com.nokia.phone.net" target="_blank">com.nokia.phone.net</a> /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1<br><br>But when I try to implement the same method call in my program i get the error:<br>
<br>Error: <br>"rpc.Error" <br>"can't find method Phone.Net::set_selected_radio_access_technology" <br><br>The code I use looks like this:<br><br>#include "cellular.h"<br>#include <QDBusConnection><br>
#include <QDBusMessage><br>#include <QDebug><br><br>Cellular::Cellular() : QObject() {<br> QList<QVariant> radioModeArguments;<br> radioModeArguments.append((unsigned char)1);<br><br> QDBusMessage message = QDBusMessage::createMethodCall("<a href="http://com.nokia.phone.net" target="_blank">com.nokia.phone.net</a>", "/com/nokia/phone/net", "Phone.Net", "set_selected_radio_access_technology");<br>
message.setArguments(radioModeArguments);<br><br> QDBusMessage result = QDBusConnection::systemBus().call(message, QDBus::Block);<br> qDebug() << "Error:";<br> qDebug() << result.errorName();<br>
qDebug() << result.errorMessage();<br><br> QList<QVariant> resultArguments = result.arguments();<br><br> for (int i = 0; i < resultArguments.size(); ++i) {<br> qDebug() << resultArguments[i];<br>
}<br>}<br><br>I have attached all the relevant files (header, .pro, main).<br><br>I'm completly lost to what the problem can be, do you have any ideas?<br><br>Best regards<br><font color="#888888">Linus<br>
</font></blockquote></div><br>