2015-06-07 01:22:17

by Joshua Kramer

[permalink] [raw]
Subject: Are there any simple GATT examples?

Hello-

Is there an example of a GATT server that implements a simple
socket-type connection? I am creating a device based on Raspberry Pi
that needs to be controlled via an Android app. I am using bluez on
the Pi side.

Thanks!
-JK


2015-06-08 10:03:47

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Are there any simple GATT examples?

Hi Joshua,

On Sun, Jun 7, 2015 at 4:22 AM, Joshua Kramer <[email protected]> wrote:
> Hello-
>
> Is there an example of a GATT server that implements a simple
> socket-type connection? I am creating a device based on Raspberry Pi
> that needs to be controlled via an Android app. I am using bluez on
> the Pi side.

Well a GATT service/attribute alone cannot do socket-type connection,
what you can do is to use write and read/notifications to emulate it
but the proper way would be to use connection oriented channels if
Android support it (which I don't think it does).

If you are just after a generic example there is one in BlueZ source
tree: https://git.kernel.org/cgit/bluetooth/bluez.git/tree/test/example-gatt-server


--
Luiz Augusto von Dentz