I'm in the process of converting a BLE project using GATT on an ESP32 board to the Feather nRF52840. Data is sent from the MCU to a smartphone application, and using the ESP32 I can achieve a throughput of +4,500 B/s.
I'm new to Adafruit, and noticed many of the Bluefruit nRF52 sketches involve BLE UART. Is there any benefit to switching from GATT to UART? My Google Fu did not turn up anything note worthy.
Maybe there is a difference in power usage, or some such thing?
My smartphone application is currenly written with support for GATT, and while it can be switched to support UART it's not clear how much time this would take. For now, BLE data transmission is one way: from the peripheral to the central. In the future it may be two way information, but only for simple commands back to the peripheral like "pause transmission".
Any advice would be appreciated, thanks
GATT vs UART - What are the benefits of each?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- LePetitRenard
- Posts: 15
- Joined: Tue Oct 25, 2022 10:24 am
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: GATT vs UART - What are the benefits of each?
BLE UART uses the same software interface as Serial in the Arduino environment, so it's familiar. Also, working with the data has the same flexibility as any other form of text processing. Overall though, it bypasses most of the complexity in the GATT protocol.
GATT is how BLE was designed to be used, and BLE UART is implemented as a GATT service under the hood. GATT gives you the flexibility to read or set specific attributes when you want them. You have to deal with the mildly confusing profiles/services/attributes structure in your code, but once you've learned that system, you can enjoy its benefits without much additional effort.
GATT is how BLE was designed to be used, and BLE UART is implemented as a GATT service under the hood. GATT gives you the flexibility to read or set specific attributes when you want them. You have to deal with the mildly confusing profiles/services/attributes structure in your code, but once you've learned that system, you can enjoy its benefits without much additional effort.
Please be positive and constructive with your questions and comments.