GATT notifications let a website or application know when a particular characteristic changes on a device. For example, a descriptor could explain the expected range for a value or a unit of measure being used for a value. They can be used to provide information that makes it easier to understand what a characteristic’s value represents. For example, you could have a service called “Battery” that includes characteristics like the current battery level and the estimated amount of time remaining before the battery needs recharging.ĭescriptors Descriptors are defined attributes that describe a characteristic value. Services GATT services are collections of related characteristics. Characteristic name Describes what the characteristic is, such as battery level or heart rate.When sharing data between Bluetooth devices, GATT organizes the data into characteristics, services, and descriptors.Ĭharacteristics Characteristics hold user data and have at least two attributes: Bluetooth devices generally serve this role. It can also be configured to send data on its own without receiving a request from a client. The GATT server gets requests from a client and returns data. In our case, the GATT client is a web browser that supports the Web Bluetooth API. The GATT client sends requests to a Bluetooth device and gets responses from it. Even more important, it provides a reference framework that’s used for all devices with GATT-based profiles to ensure that devices from different vendors work together. It describes the data transfer processes and formats. GATT plays an integral role in defining how data is shared over a Bluetooth connection. Here are a few key concepts you’re likely to come across as you start working with the Web Bluetooth API. If you’re new to how Bluetooth devices work, I’ll explain some of the concepts above. Reading and writing Bluetooth descriptors. Receiving notifications when a device is disconnected. Reading and writing Bluetooth characteristics.Requesting and connecting to nearby devices.Some of the things you can do with the Web Bluetooth API include: Getting a device’s battery level with the Web Bluetooth APIĪlthough this API is still considered experimental technology, it has decent support in Google Chrome, Edge, and Opera.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |