GATT profile and UART service

非 Y 不嫁゛ 提交于 2021-02-07 13:27:28

问题


I am new to developing a mobile app with bluetooth connection to peripheral device. I searched that GATT is the relevant profile used for bluetoothLE communication but our client recommended that we use UART service. Now I am confused as to 1. how these two things are related and 2. Do we have to opt for one of these, if so, what are the pros and cons of each. Thanks


回答1:


Legacy Bluetooth provides the serial port profile (SPP) - This is essentially a serial input/output stream over Bluetooth.

Bluetooth Low Energy provides a number of profiles, but the most commonly used is GATT. GATT exposes characteristics/attributes which are a little like variables that you can read from/write to. A read/write is limited to 20 bytes.

Many embedded BLE chipsets provide a "UART emulation" over BLE GATT. Here a pair of attributes are used; one for read and one for write.

The Central device writes bytes to the 'write' attribute and the embedded chip sends them out of a serial port on the chip.

Similarly, data that is written to the chip's serial port and sent to the central via a notification of new data in the 'read' attribute.

You don't say what platform your are developing on, but one important consideration is that use of SPP on iOS requires your hardware to be MFi certified by Apple, while BLE/GATT does not.



来源:https://stackoverflow.com/questions/37981000/gatt-profile-and-uart-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!