Is it possible to just add a single GATT characteristic to a BLE device and read from a bluetooth receiver, or do I need to add a GATT service to the BLE device to be able to read from the device? Would I need a GATT service apart from the Analog Output GATT characteristic to simply read analog output? In the end I simply want to read 16-bit bytes from a buffer on an arduino uno and send them over bluetooth.
1 Answers
Of course you need a service too. Service is a container for the characteristics.
The Generic Attributes (GATT) define a hierarchical data structure that is exposed to connected Bluetooth Low Energy (LE) devices. The GATT profiles describe a use case, roles and general behaviors based on the GATT functionality. Services are collections of characteristics and relationships to other services that encapsulate the behavior of part of a device. This also includes hierarchy of services, characteristics and attributes used in the attribute server. On top of the GATT hierarchy is a profile, which is composed of one or more services necessary to fulfill a use case. A service is composed of characteristics or references to other services. A characteristic consists of a type (represented by a UUID), a value, a set of properties indicating the operations the characteristic supports and a set of permissions relating to security. It may also include one or more descriptors—metadata or configuration flags relating to the owning characteristic. GATT defines client (BLE Central) and server (BLE Peripheral) roles. The GATT server stores the data transported over the air to the GATT client and accepts requests, commands and confirmations from the GATT client. The GATT server sends responses to requests and sends indications and notifications asynchronously to the GATT client when specified events occur on the GATT server. GATT also specifies the format of data contained on the GATT server.