I'm trying to understand what GATT is.<p>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 encryption, authentication, and authorization. Generic Attribute Profile (GATT) is a service discovery/management framework built around ATT.<p>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.<p>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?<p>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?<p>Found in the Bluetooth 5.4 spec:<p><i>Part G. Generic Attribute Profile (GATT)</i>: <a href="https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Core-54/out/en/host/generic-attribute-profile--gatt-.html" rel="nofollow">https://www.bluetooth.com/wp-content/uploads/Files/Specifica...</a><p><i>Part F. Attribute Protocol (ATT)</i>: <a href="https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Core-54/out/en/host/attribute-protocol--att-.html" rel="nofollow">https://www.bluetooth.com/wp-content/uploads/Files/Specifica...</a>
Equivalent in Rust: <a href="https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/bluetooth.rs#L106">https://github.com/embassy-rs/embassy/blob/main/examples/rp/...</a>
GATT is great if you want to make yet another heart rate monitor. I was building a lock that worked over BTLE and I spent most of my time trying to get around the problems with GATT. It's been 8 years now but I believe that that there was a bunch of extra overhead that bloated the packets and the packets were too small. Resulted in too much back and forth etc. I really just wanted a socket. iOS eventually allowed you to interact directly with the Logical Link Control and Adaptation Protocol aka L2CAP. Seems like every time someone try to design a generic structure that does one job but is also extendable, it's a mess. Just give me the byte stream and move on. L2CAP doesn't seem to be accessible on the pico yet, <a href="https://github.com/micropython/micropython-lib/issues/803">https://github.com/micropython/micropython-lib/issues/803</a>
It’s not a full generic GATT server but I implemented a server for temperature sensors with MicroPython if anyone is curious what that looks like. I have it running on two picos to collect data across my house and then I push it to a MQTT server. Honestly would love feedback too because it’s pretty gross and error prone.<p><a href="https://git.tcrez.dev/tcrez/micropython/src/branch/main/temperature_ble_relay/main.py" rel="nofollow">https://git.tcrez.dev/tcrez/micropython/src/branch/main/temp...</a>
When I last look at the description of the Pi Pico W from adafruit<p><a href="https://www.adafruit.com/product/5544" rel="nofollow">https://www.adafruit.com/product/5544</a><p>it says:<p>"Bluetooth Low Energy - note this isn't supported in software yet, its just a hardware capability."<p>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?