Return-Path: Message-ID: <3e9cdced0805200104nf8cbc16r24ac63f874c8e9d0@mail.gmail.com> Date: Tue, 20 May 2008 10:04:21 +0200 From: "Fritz Code" To: bluez-users@lists.sourceforge.net MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_53_27858130.1211270661954" Subject: [Bluez-users] Cant receive signals from Adapter (low-level dbus API) Reply-To: BlueZ users List-Id: BlueZ users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: bluez-users-bounces@lists.sourceforge.net Errors-To: bluez-users-bounces@lists.sourceforge.net ------=_Part_53_27858130.1211270661954 Content-Type: multipart/alternative; boundary="----=_Part_54_32032955.1211270661954" ------=_Part_54_32032955.1211270661954 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, attached is a small test application. With this application I want to test the handling of signals from bluez Adapter. Therefore I always change the name of my bluetooth device, in order to make the adapter to generate a signal. Unfortunately I cant receive this signal. I can set and get the name correctly. BUt it seems I receive at least some signals: When I start the application I get a signal with value :1.20 If I remove my usb bluetooth dongle I get a signal with value off. In another application I had the same problem (receiving not the expected signals: e.g.: DiscoveryStarted() ... ) when I sent signal DiscoverDevices. thanks. -- Regards, --Codefritz ------=_Part_54_32032955.1211270661954 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi,

attached is a small test application.
With this application I want to test the handling of signals from bluez Adapter.
Therefore I always change the name of my bluetooth device, in order to make the adapter to
generate a signal.
Unfortunately I cant receive this signal.
I can set and get the name correctly.
BUt it seems I receive at least some signals:
When I start the application I get a signal with value :1.20
If I remove my usb bluetooth dongle I get a signal with value off.




In another application I had the same problem (receiving not the expected signals: e.g.: DiscoveryStarted() ... )
 when I sent signal DiscoverDevices.


thanks.

--
Regards,
--Codefritz



------=_Part_54_32032955.1211270661954-- ------=_Part_53_27858130.1211270661954 Content-Type: text/x-csrc; name=test.c Content-Transfer-Encoding: base64 X-Attachment-Id: f_fgg73a9f0 Content-Disposition: attachment; filename=test.c I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPGRidXMvZGJ1 cy5oPgoKCmludCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikKewogICAgREJ1c0Nvbm5lY3Rp b24gKmNvbm47CiAgICBEQnVzTWVzc2FnZSAqbXNnLCAqcmVwbHk7CiAgICBEQnVzRXJyb3IgZXJy OwogICAgREJ1c01lc3NhZ2VJdGVyIGFyZ3M7CiAgICBjb25zdCBjaGFyICphZGRyOwogICAgY29u c3QgY2hhciAqbmFtZTsKICAgIGNvbnN0IGNoYXIgKm1hbnVmOwogICAgdm9pZCAqc2lndmFsdWU7 CgogICAgY2hhciBkaXNwTXNnWzEwXTsKICAgIGNoYXIgKm5hbWVzWzVdID0geyAidGVzdDEiLCAi dGVzdDIiLCAidGVzdDMiLCAidGVzdDQiLCAidGVzdDUifTsKCiAgICBpbnQgaT0wOwoKICAgIGRi dXNfZXJyb3JfaW5pdCgmZXJyKTsKCiAgICBwcmludGYoIkNvbm5lY3RpbmcgdG8gdGhlIGJ1cyAu Li5cbiIpOwogICAgY29ubiA9IGRidXNfYnVzX2dldChEQlVTX0JVU19TWVNURU0sICZlcnIpOwog ICAgaWYgKGRidXNfZXJyb3JfaXNfc2V0KCZlcnIpKSB7IAogICAgICBmcHJpbnRmKHN0ZGVyciwg IkNvbm5lY3Rpb24gRXJyb3IgKCVzKVxuIiwgZXJyLm1lc3NhZ2UpOwogICAgICBkYnVzX2Vycm9y X2ZyZWUoJmVycik7IAogICB9CiAgICBpZiAoTlVMTCA9PSBjb25uKSB7IAogICAgICBleGl0KDEp OwogICAgfQogICAgCiAgICAKCiAgICAvLyBhZGQgYSBydWxlIGZvciB3aGljaCBtZXNzYWdlcyB3 ZSB3YW50IHRvIHNlZSAgICAKICAgIGRidXNfYnVzX2FkZF9tYXRjaChjb25uLCAKIAkgCSAgICAg ICAidHlwZT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2FnZV91bnJlZihtc2cpOwogICAgZGJ1c19tZXNzYWdlX3VucmVmKHJlcGx5KTsgCgoKCgoKICAg IHByaW50ZigiR2V0TmFtZSgpOiIpOwogICAgbXNnID0gZGJ1c19tZXNzYWdlX25ld19tZXRob2Rf Y2FsbCgib3JnLmJsdWV6IiwgIi9vcmcvYmx1ZXovaGNpMCIsCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouQWRhcHRlciIsICJHZXRO YW1lIik7CiAgICByZXBseSA9IGRidXNfY29ubmVjdGlvbl9zZW5kX3dpdGhfcmVwbHlfYW5kX2Js b2NrKGNvbm4sIG1zZywgLTEsIE5VTEwpOwogICAgZGJ1c19tZXNzYWdlX2dldF9hcmdzKHJlcGx5 LCBOVUxMLCBEQlVTX1RZUEVfU1RSSU5HLCAmbmFtZSwgREJVU19UWVBFX0lOVkFMSUQpOwogICAg cHJpbnRmKCIgJXNcbiIsIG5hbWUpOwogICAgZGJ1c19tZXNzYWdlX3VucmVmKG1zZyk7CiAgICBk YnVzX21lc3NhZ2VfdW5yZWYocmVwbHkpOyAKCgoKCiAgICBkYnVzX2Nvbm5lY3Rpb25fY2xvc2Uo Y29ubik7CgogICAgcmV0dXJuIDA7Ki8KfQo= ------=_Part_53_27858130.1211270661954 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ ------=_Part_53_27858130.1211270661954 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ------=_Part_53_27858130.1211270661954--