Hi all,
1. I use the latest version of Bluez and run as "bluetoothd -Edn" to test gatt.
2. I try to use example-gatt-server to test it.
However, it failed. Please check the following log.
Run "Bluetooth -Edn"
"
bluetoothd[17456]: src/gatt-database.c:manager_register_service() Registering service - path: /org/bluez/example/service0
bluetoothd[17456]: src/gatt-database.c:manager_register_service() Registering service - path: /org/bluez/example/service1
bluetoothd[17456]: src/gatt-database.c:manager_register_service() Registering service - path: /org/bluez/example/service2
bluetoothd[17456]: src/gatt-database.c:client_disconnect_cb() Client disconnected
bluetoothd[17456]: src/gatt-database.c:client_disconnect_cb() Client disconnected
bluetoothd[17456]: src/gatt-database.c:client_disconnect_cb() Client disconnected
"
Then Run "./example-gatt-server"
"
./example-gatt-server
Battery Level drained: 98
Battery Level drained: 96
Battery Level drained: 94
Battery Level drained: 92
Failed to register service: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
"
After checked the source code, I find that "RegisterService" not return the dbus message and only after invoking client_ready_cb, the dbus message is returned.
I missed some steps to test it? Please help. Thanks.
Best Regards
Zheng Wu
Hi,
On Mon, Jun 29, 2015 at 12:00 PM, Zheng, Wu <[email protected]> wrote:
> Hi all,
>
> 1. I use the latest version of Bluez and run as "bluetoothd -Edn" to test gatt.
>
> 2. I try to use example-gatt-server to test it.
>
> However, it failed. Please check the following log.
>
> Run "Bluetooth -Edn"
> "
> bluetoothd[17456]: src/gatt-database.c:manager_register_service() Registering service - path: /org/bluez/example/service0
> bluetoothd[17456]: src/gatt-database.c:manager_register_service() Registering service - path: /org/bluez/example/service1
> bluetoothd[17456]: src/gatt-database.c:manager_register_service() Registering service - path: /org/bluez/example/service2
> bluetoothd[17456]: src/gatt-database.c:client_disconnect_cb() Client disconnected
> bluetoothd[17456]: src/gatt-database.c:client_disconnect_cb() Client disconnected
> bluetoothd[17456]: src/gatt-database.c:client_disconnect_cb() Client disconnected
> "
>
> Then Run "./example-gatt-server"
> "
> ./example-gatt-server
> Battery Level drained: 98
> Battery Level drained: 96
> Battery Level drained: 94
> Battery Level drained: 92
> Failed to register service: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
> "
>
> After checked the source code, I find that "RegisterService" not return the dbus message and only after invoking client_ready_cb, the dbus message is returned.
>
> I missed some steps to test it? Please help. Thanks.
Check if you had update the D-Bus policy file, we will try to access
the clients services via ObjectManager etc, so you need the policy to
enable that.
--
Luiz Augusto von Dentz
SGkgTHVpeiwNCg0KVGhhbmtzLiBJdCB3b3JrIHdlbGwuDQoNCkJlc3QgUmVnYXJkcw0KWmhlbmcg
V3UNCg0KLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IEx1aXogQXVndXN0byB2b24g
RGVudHogW21haWx0bzpsdWl6LmRlbnR6QGdtYWlsLmNvbV0gDQpTZW50OiBNb25kYXksIEp1bmUg
MjksIDIwMTUgNzozMyBQTQ0KVG86IFpoZW5nLCBXdQ0KQ2M6IGxpbnV4LWJsdWV0b290aEB2Z2Vy
Lmtlcm5lbC5vcmcNClN1YmplY3Q6IFJlOiBob3cgdG8gdXNlICJleGFtcGxlLWdhdHQtc2VydmVy
IiB0ZXN0IGdhdHQ/DQoNCkhpLA0KDQpPbiBNb24sIEp1biAyOSwgMjAxNSBhdCAxMjowMCBQTSwg
WmhlbmcsIFd1IDx3dS56aGVuZ0BpbnRlbC5jb20+IHdyb3RlOg0KPiBIaSBhbGwsDQo+DQo+IDEu
IEkgdXNlIHRoZSBsYXRlc3QgdmVyc2lvbiBvZiBCbHVleiBhbmQgcnVuIGFzICJibHVldG9vdGhk
ICAtRWRuIiB0byB0ZXN0IGdhdHQuDQo+DQo+IDIuIEkgdHJ5IHRvIHVzZSBleGFtcGxlLWdhdHQt
c2VydmVyIHRvIHRlc3QgaXQuDQo+DQo+IEhvd2V2ZXIsIGl0IGZhaWxlZC4gU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