* error in setting speakergain in own application
@ 2009-09-02 11:52 Peter Kornatowski
2009-09-02 14:37 ` Bastien Nocera
0 siblings, 1 reply; 5+ messages in thread
From: Peter Kornatowski @ 2009-09-02 11:52 UTC (permalink / raw)
To: linux-bluetooth
Hi,
I have a linux application where i do some stuff with bluez (4.50) over dbus. I have 3 headsets with which I test (Jabra BT530, Sora B-Speech, official PS3-BT headset) and on all I get the same behaviour/error.
I would like to set the speakergain of a headset from my linux-app. I tried two methods:
a) call the method "SetProperty":
GValue value;
value.g_type = 0; // also tried: value = { 0 };
guint16 ugain = (guint16)gain; // also tried: guint ugain = (guint)gain;
g_value_init(&value, G_TYPE_UINT);
g_value_set_uint(&value, ugain);
dbus_g_proxy_call(proxy, "SetProperty", &error, G_TYPE_STRING,
"SpeakerGain", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID);
g_value_unset(&value);
>From error->message I always get: Invalid arguments in method call
I get the same error when trying to set it through d-feet (but probably because d-feet can't set a value type?).
b) call the method "SetSpeakerGain" (it is deprecated, but the deprecated signal "SpeakerGainChanged" still works, too):
guint16 ugain = (guint16)gain; // also tried: guint ugain = (guint)gain;
dbus_g_proxy_call(proxy, "SetSpeakerGain", &err, G_TYPE_UINT, ugain, G_TYPE_INVALID, G_TYPE_INVALID);
>From error->message I always get: Method "SetSpeakerGain" with signature "u" on interface "org.bluez.Headset" doesn't exist
Calling this method with d-feet works fine, the new value is transferred to the headset.
Does anyone have any idea how this could work? Thanks!
Greetings,
Peter
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: error in setting speakergain in own application
2009-09-02 11:52 error in setting speakergain in own application Peter Kornatowski
@ 2009-09-02 14:37 ` Bastien Nocera
2009-09-02 18:11 ` Peter Kornatowski
0 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2009-09-02 14:37 UTC (permalink / raw)
To: Peter Kornatowski; +Cc: linux-bluetooth
On Wed, 2009-09-02 at 13:52 +0200, Peter Kornatowski wrote:
> Hi,
>
> I have a linux application where i do some stuff with bluez (4.50) over dbus. I have 3 headsets with which I test (Jabra BT530, Sora B-Speech, official PS3-BT headset) and on all I get the same behaviour/error.
>
> I would like to set the speakergain of a headset from my linux-app. I tried two methods:
>
> a) call the method "SetProperty":
>
> GValue value;
> value.g_type = 0; // also tried: value = { 0 };
> guint16 ugain = (guint16)gain; // also tried: guint ugain = (guint)gain;
> g_value_init(&value, G_TYPE_UINT);
> g_value_set_uint(&value, ugain);
> dbus_g_proxy_call(proxy, "SetProperty", &error, G_TYPE_STRING,
> "SpeakerGain", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID);
This would work (and you don't need to use a GValue, the call will take
care of marshalling the value to the proper type:
dbus_g_proxy_call(proxy, "SetProperty", &error, G_TYPE_STRING,
"SpeakerGain", G_TYPE_UINT, ugain, G_TYPE_INVALID, G_TYPE_INVALID);
> g_value_unset(&value);
Cheers
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: error in setting speakergain in own application
2009-09-02 14:37 ` Bastien Nocera
@ 2009-09-02 18:11 ` Peter Kornatowski
2009-09-02 18:22 ` Bastien Nocera
0 siblings, 1 reply; 5+ messages in thread
From: Peter Kornatowski @ 2009-09-02 18:11 UTC (permalink / raw)
To: linux-bluetooth
-------- Original-Nachricht --------
> Datum: Wed, 02 Sep 2009 15:37:59 +0100
> Von: Bastien Nocera <hadess@hadess.net>
> An: Peter Kornatowski <pkorn@gmx.net>
> CC: linux-bluetooth@vger.kernel.org
> Betreff: Re: error in setting speakergain in own application
> On Wed, 2009-09-02 at 13:52 +0200, Peter Kornatowski wrote:
> > Hi,
> >
> > I have a linux application where i do some stuff with bluez (4.50) over
> dbus. I have 3 headsets with which I test (Jabra BT530, Sora B-Speech,
> official PS3-BT headset) and on all I get the same behaviour/error.
> >
> > I would like to set the speakergain of a headset from my linux-app. I
> tried two methods:
> >
> > a) call the method "SetProperty":
> >
> > GValue value;
> > value.g_type = 0; // also tried: value = { 0 };
> > guint16 ugain = (guint16)gain; // also tried: guint ugain = (guint)gain;
> > g_value_init(&value, G_TYPE_UINT);
> > g_value_set_uint(&value, ugain);
> > dbus_g_proxy_call(proxy, "SetProperty", &error, G_TYPE_STRING,
> > "SpeakerGain", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID);
>
> This would work (and you don't need to use a GValue, the call will take
> care of marshalling the value to the proper type:
> dbus_g_proxy_call(proxy, "SetProperty", &error, G_TYPE_STRING,
> "SpeakerGain", G_TYPE_UINT, ugain, G_TYPE_INVALID, G_TYPE_INVALID);
Thanks for the idea, but now I get the following error:
Method "SetProperty" with signature "su" on interface "org.bluez.Headset" doesn't exist
So the value is not set to the proper type, it still remains "u".
Do you have any other ideas?
Greetings, Peter
>
> > g_value_unset(&value);
>
> Cheers
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: error in setting speakergain in own application
2009-09-02 18:11 ` Peter Kornatowski
@ 2009-09-02 18:22 ` Bastien Nocera
0 siblings, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2009-09-02 18:22 UTC (permalink / raw)
To: Peter Kornatowski; +Cc: linux-bluetooth
On Wed, 2009-09-02 at 20:11 +0200, Peter Kornatowski wrote:
> -------- Original-Nachricht --------
> > Datum: Wed, 02 Sep 2009 15:37:59 +0100
> > Von: Bastien Nocera <hadess@hadess.net>
> > An: Peter Kornatowski <pkorn@gmx.net>
> > CC: linux-bluetooth@vger.kernel.org
> > Betreff: Re: error in setting speakergain in own application
>
> > On Wed, 2009-09-02 at 13:52 +0200, Peter Kornatowski wrote:
> > > Hi,
> > >
> > > I have a linux application where i do some stuff with bluez (4.50) over
> > dbus. I have 3 headsets with which I test (Jabra BT530, Sora B-Speech,
> > official PS3-BT headset) and on all I get the same behaviour/error.
> > >
> > > I would like to set the speakergain of a headset from my linux-app. I
> > tried two methods:
> > >
> > > a) call the method "SetProperty":
> > >
> > > GValue value;
> > > value.g_type = 0; // also tried: value = { 0 };
> > > guint16 ugain = (guint16)gain; // also tried: guint ugain = (guint)gain;
> > > g_value_init(&value, G_TYPE_UINT);
> > > g_value_set_uint(&value, ugain);
> > > dbus_g_proxy_call(proxy, "SetProperty", &error, G_TYPE_STRING,
> > > "SpeakerGain", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID);
> >
> > This would work (and you don't need to use a GValue, the call will take
> > care of marshalling the value to the proper type:
> > dbus_g_proxy_call(proxy, "SetProperty", &error, G_TYPE_STRING,
> > "SpeakerGain", G_TYPE_UINT, ugain, G_TYPE_INVALID, G_TYPE_INVALID);
>
> Thanks for the idea, but now I get the following error:
> Method "SetProperty" with signature "su" on interface "org.bluez.Headset" doesn't exist
>
> So the value is not set to the proper type, it still remains "u".
> Do you have any other ideas?
Never mind, I didn't read your code properly.
The original code should work, given that the proxy used is the correct
one. Check what path the proxy object has using dbus_g_proxy_get_path()
and check against what you see in D-Feet (repeat with the name and
interface if you didn't find a discrepancy).
Cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <7.0.1.0.2.20090903112603.0220ed58@gmx.net>]
* Re: error in setting speakergain in own application
[not found] <7.0.1.0.2.20090903112603.0220ed58@gmx.net>
@ 2009-09-03 14:38 ` Peter Kornatowski
0 siblings, 0 replies; 5+ messages in thread
From: Peter Kornatowski @ 2009-09-03 14:38 UTC (permalink / raw)
To: linux-bluetooth
-------- Original-Nachricht --------
> Datum: Thu, 03 Sep 2009 11:26:47 +0200
> Von: Peter Kornatowski <pkorn@gmx.net>
> An: pkorn@gmx.net
> Betreff: Re: error in setting speakergain in own application
> Subject: Re: error in setting speakergain in own application
> From: Bastien Nocera <hadess@hadess.net>
> To: Peter Kornatowski <pkorn@gmx.net>
> Cc: linux-bluetooth@vger.kernel.org
>
> On Wed, 2009-09-02 at 20:11 +0200, Peter Kornatowski wrote:
> > -------- Original-Nachricht --------
> > > Datum: Wed, 02 Sep 2009 15:37:59 +0100
> > > Von: Bastien Nocera <hadess@hadess.net>
> ...snip...
> >
> > So the value is not set to the proper type, it still remains "u".
> > Do you have any other ideas?
>
> Never mind, I didn't read your code properly.
>
> The original code should work, given that the proxy used is the correct
> one. Check what path the proxy object has using dbus_g_proxy_get_path()
> and check against what you see in D-Feet (repeat with the name and
> interface if you didn't find a discrepancy).
I checked it all, but because all signals work fine an error here was very unlikely. And it is all exactly the same like in d-feet:
path: /org/bluez/2516/hci0/dev_00_1D_82_XX_XX_XX
bus: org.bluez
iface: org.bluez.Headset
But still getting this "Invalid arguments in method call" error... any other thoughts?
Greetings, Peter
>
> Cheers
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-09-03 14:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-02 11:52 error in setting speakergain in own application Peter Kornatowski
2009-09-02 14:37 ` Bastien Nocera
2009-09-02 18:11 ` Peter Kornatowski
2009-09-02 18:22 ` Bastien Nocera
[not found] <7.0.1.0.2.20090903112603.0220ed58@gmx.net>
2009-09-03 14:38 ` Peter Kornatowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox