Wops, forgot to attach the actual code :) 2010/8/8 Linus <[email protected]>
> Hi,
>
> 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 wiki.maemo.org/Phone_Control):
>
> dbus-send --system --type=method_call
> --dest=com.nokia.phone.net/com/nokia/phone/net
> Phone.Net.set_selected_radio_access_technology byte:1
>
> But when I try to implement the same method call in my program i get the
> error:
>
> Error:
> "rpc.Error"
> "can't find method Phone.Net::set_selected_radio_access_technology"
>
> The code I use looks like this:
>
> #include "cellular.h"
> #include <QDBusConnection>
> #include <QDBusMessage>
> #include <QDebug>
>
> Cellular::Cellular() : QObject() {
> QList<QVariant> radioModeArguments;
> radioModeArguments.append((unsigned char)1);
>
> QDBusMessage message = QDBusMessage::createMethodCall("
> com.nokia.phone.net", "/com/nokia/phone/net", "Phone.Net",
> "set_selected_radio_access_technology");
> message.setArguments(radioModeArguments);
>
> QDBusMessage result = QDBusConnection::systemBus().call(message,
> QDBus::Block);
> qDebug() << "Error:";
> qDebug() << result.errorName();
> qDebug() << result.errorMessage();
>
> QList<QVariant> resultArguments = result.arguments();
>
> for (int i = 0; i < resultArguments.size(); ++i) {
> qDebug() << resultArguments[i];
> }
> }
>
> I have attached all the relevant files (header, .pro, main).
>
> I'm completly lost to what the problem can be, do you have any ideas?
>
> Best regards
> Linus
>
mode.tar
Description: Unix tar archive
_______________________________________________ maemo-developers mailing list [email protected] https://lists.maemo.org/mailman/listinfo/maemo-developers
