Building a GATT Server on Pi Pico W
vanhunteradams.com
Building a GATT Server on Pi Pico W
1–10 of 18 posts
Re: Building a GATT Server on Pi Pico W
#2From what I've found in the links below, it looks Bluetooth 5.4 spec contains an Attribute Protocol (ATT) that allows for sharing of custom attributes between bluetooth devices. Attributes have a type identified by UUID, a server-specific 16-bit handle, a higher-level handle group, a value, and then permissions. Permissions specify read/write capability and requirements for encryption, authentication, and authorization. Generic Attribute Profile (GATT) is a service discovery/management framework built around ATT.
While wondering about what applications this is intended for, I found an example in Figure 2.2 the GATT spec (2nd link) showing a computer communicating with a sensor over bluetooth, so presumably, this is ATT and GATT are meant to improve IoT networks utilizing bluetooth. Appendixes A and B show examples of the protocol containing data for battery status, temperature sensors, and glucose monitors.
Is this the current state of the art for this type of information over Bluetooth, or is there something else that is currently being used?
I'd like to see a Pi Pico W bluetooth host for my custom split keyboards, and it obtaining from the the battery status to display on a small LCD/OLED display. The Nordic nRF52-based keyboards I have are already capable of reporting that type of information over bluetooth, so is that an example of GATT in the wild? Is GATT what's currently enabling my Apple Magic Trackpad and Pixel Buds Pro to report their battery status over bluetooth, or will GATT be the next generation of that capability?
Found in the Bluetooth 5.4 spec:
Part G. Generic Attribute Profile (GATT): https://www.bluetooth.com/wp-content/uploads/Files/Specifica...
Part F. Attribute Protocol (ATT): https://www.bluetooth.com/wp-content/uploads/Files/Specifica...
Re: Building a GATT Server on Pi Pico W
#3Re: Building a GATT Server on Pi Pico W
#4I'm trying to understand what GATT is. From what I've found in the links below, it looks Bluetooth 5.4 spec contains an Attribute Protocol (ATT) that allows for sharing of custom attributes between bluetooth devices. Attributes have a type identified by UUID, a server-specific 16-bit handle, a higher-level handle group, a value, and then permissions. Permissions specify read/write capability and requirements for encr…
Re: Building a GATT Server on Pi Pico W
#5Equivalent in Rust: https://github.com/embassy-rs/embassy/blob/main/examples/rp/...
Re: Building a GATT Server on Pi Pico W
#6Re: Building a GATT Server on Pi Pico W
#7I'm trying to understand what GATT is. From what I've found in the links below, it looks Bluetooth 5.4 spec contains an Attribute Protocol (ATT) that allows for sharing of custom attributes between bluetooth devices. Attributes have a type identified by UUID, a server-specific 16-bit handle, a higher-level handle group, a value, and then permissions. Permissions specify read/write capability and requirements for encr…
Re: Building a GATT Server on Pi Pico W
#8I'm trying to understand what GATT is. From what I've found in the links below, it looks Bluetooth 5.4 spec contains an Attribute Protocol (ATT) that allows for sharing of custom attributes between bluetooth devices. Attributes have a type identified by UUID, a server-specific 16-bit handle, a higher-level handle group, a value, and then permissions. Permissions specify read/write capability and requirements for encr…
The spec is very bad, I'm sorry but I understand the amount of effort that must have gone into building it. There are blatant holes in the entire spec, documents are broken apart in some chaotic pattern where to implement a single ATT you need to reference 3 documents simultaneously(almost).
The documents have broken links or just flat out incorrect links. Worst part is, a lot of device manufacturers just yeet the GATT out the window and have custom UUIDs with custom everything which you'll never be able to implement properly with reverse engineering it.
Idk I think the spec is a good initiative marred by execution
Re: Building a GATT Server on Pi Pico W
#9I'm trying to understand what GATT is. From what I've found in the links below, it looks Bluetooth 5.4 spec contains an Attribute Protocol (ATT) that allows for sharing of custom attributes between bluetooth devices. Attributes have a type identified by UUID, a server-specific 16-bit handle, a higher-level handle group, a value, and then permissions. Permissions specify read/write capability and requirements for encr…
Keys are 16-bit "handles", values are arbitrary byte bags. Handles may change between connections and are not considered stable, which is why there is a higher level of abstraction used. Each K-V pair is called an attribute.
On top of that simple kv-store, are built higher-level concepts like characteristics and services. A characteristic, for example, is made of a few attrbutes with sequential handles: a "header" attrbiute that declares that this is a "characteristic" and states how many next handles are part of it, a "name" attribute, which is a UUID, a "permissions" attribute, a "value" attrbiute, and possibly a "control" attribute that allows one to ask to be notified of value changes.
A "service" is a collection of attributes which describe one cohesive "thing"/feature/whatever.
Some "services" are defined in the spec and any device implementing them properly can talk to any device expecting to access them. But many devices use "manufacturer specific" services, mostly defeating the point.
GATT also specifies a number of operations to perform searches on this database, such as by-uuid, by-type, etc
Re: Building a GATT Server on Pi Pico W
#10https://www.adafruit.com/product/5544
it says:
"Bluetooth Low Energy - note this isn't supported in software yet, its just a hardware capability."
Yet this blog discusses BTStack so it must work at some level ... Can anyone clarify: if you want to use BLE on this device, is BTStack the only option or is this outdated info?