Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
GattNumbers.hpp
Go to the documentation of this file.
1 /*
2  * Author: Sven Gothel <sgothel@jausoft.com>
3  * Copyright (c) 2020 Gothel Software e.K.
4  * Copyright (c) 2020 ZAFENA AB
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish,
10  * distribute, sublicense, and/or sell copies of the Software, and to
11  * permit persons to whom the Software is furnished to do so, subject to
12  * the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be
15  * included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  */
25 
26 #ifndef GATT_NUMBERS_HPP_
27 #define GATT_NUMBERS_HPP_
28 
29 #include <cstdint>
30 
31 #include <jau/basic_types.hpp>
32 #include <jau/darray.hpp>
33 
34 #include "UUID.hpp"
35 #include "OctetTypes.hpp"
36 #include "BTTypes0.hpp"
37 #include "ieee11073/DataTypes.hpp"
38 
39 /**
40  * - - - - - - - - - - - - - - -
41  *
42  * GattNumbers.hpp Module for Higher level GATT value and service types like GattServiceType, GattCharacteristicType,
43  * GattCharacteristicProperty, GattRequirementSpec .. and finally GattServiceCharacteristic.
44  *
45  * - https://www.bluetooth.com/specifications/gatt/services/
46  *
47  * - https://www.bluetooth.com/specifications/gatt/ - See GATT Specification Supplement (GSS) Version 2
48  *
49  */
50 namespace direct_bt {
51 
52 /**
53  */
54 
55 /**
56  * GATT Service Type, each encapsulating a set of Characteristics.
57  *
58  * <pre>
59  * https://www.bluetooth.com/specifications/gatt/services/
60  *
61  * https://www.bluetooth.com/specifications/gatt/ - See GATT Specification Supplement (GSS) Version 2
62  * </pre>
63  */
64 enum GattServiceType : uint16_t {
65  /** This service contains generic information about the device. This is a mandatory service. */
66  GENERIC_ACCESS = 0x1800,
67  /** The service allows receiving indications of changed services. This is a mandatory service. */
69  /** This service exposes a control point to change the peripheral alert behavior. */
70  IMMEDIATE_ALERT = 0x1802,
71  /** The service defines behavior on the device when a link is lost between two devices. */
72  LINK_LOSS = 0x1803,
73  /** This service exposes temperature and other data from a thermometer intended for healthcare and fitness applications. */
75  /** This service exposes manufacturer and/or vendor information about a device. */
77  /** This service exposes the state of a battery within a device. */
78  BATTERY_SERVICE = 0x180F,
79 };
80 std::string GattServiceTypeToString(const GattServiceType v) noexcept;
81 
82 /**
83  * GATT Assigned Characteristic Attribute Type for single logical value.
84  * <p>
85  * https://www.bluetooth.com/specifications/gatt/characteristics/
86  * </p>
87  */
88 enum GattCharacteristicType : uint16_t {
89  //
90  // GENERIC_ACCESS
91  //
92  DEVICE_NAME = 0x2A00,
93  APPEARANCE = 0x2A01,
97 
98  /** Mandatory: sint16 10^-2: Celsius */
99  TEMPERATURE = 0x2A6E,
100 
101  /** Mandatory: sint16 10^-1: Celsius */
104 
105  //
106  // HEALTH_THERMOMETER
107  //
109  /** Mandatory: 8bit: 1 armpit, 2 body (general), 3(ear), 4 (finger), ... */
113 
114  //
115  // DEVICE_INFORMATION
116  //
117  /** Mandatory: uint40 */
118  SYSTEM_ID = 0x2A23,
126  PNP_ID = 0x2A50,
127 };
128 std::string GattCharacteristicTypeToString(const GattCharacteristicType v) noexcept;
129 
131  Broadcast = 0x01,
132  Read = 0x02,
133  WriteNoAck = 0x04,
134  WriteWithAck = 0x08,
135  Notify = 0x10,
136  Indicate = 0x20,
138  ExtProps = 0x80,
139  /** FIXME: extension? */
141  /** FIXME: extension? */
142  AuxWriteExt = 0x82
143 };
145 
146 enum GattRequirementSpec : uint8_t {
147  Excluded = 0x00,
148  Mandatory = 0x01,
149  Optional = 0x02,
150  Conditional = 0x03,
153  C1 = 0x21,
154 };
155 std::string GattRequirementSpecToString(const GattRequirementSpec v) noexcept;
156 
160 
161  std::string toString() const noexcept;
162 };
163 
168 
169  std::string toString() const noexcept;
170 };
171 
175 
176  enum PropertySpecIdx : int {
177  ReadIdx = 0,
185  BroadcastIdx
186  };
187  /** Aggregated in PropertySpecIdx order */
189 
191 
192  std::string toString() const noexcept;
193 };
194 
198 
199  std::string toString() const noexcept;
200 };
201 
202 /**
203  * Intentionally ease compile and linker burden by using 'extern' instead of 'inline',
204  * as the latter would require compile to crunch the structure
205  * and linker to chose where to place the actual artifact.
206  */
210 extern const jau::darray<const GattServiceCharacteristic*> GATT_SERVICES;
211 
212 /**
213  * Find the GattServiceCharacteristic entry by given uuid16,
214  * denominating either a GattServiceType or GattCharacteristicType.
215  */
216 const GattServiceCharacteristic * findGattServiceChar(const uint16_t uuid16) noexcept;
217 
218 /**
219  * Find the GattCharacteristicSpec entry by given uuid16,
220  * denominating either a GattCharacteristicType.
221  */
222 const GattCharacteristicSpec * findGattCharSpec(const uint16_t uuid16) noexcept;
223 
224 /********************************************************
225  *
226  * Known GATT Characteristic data value types.
227  *
228  ********************************************************/
229 
230 /**
231  * Converts a GATT Name (not null-terminated) UTF8 to a null-terminated C++ string
232  */
233 std::string GattNameToString(const TROOctets &v) noexcept;
234 
235 /**
236  * <i>Peripheral Preferred Connection Parameters</i> is a GATT Characteristic.
237  * <pre>
238  * https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters.xml
239  * </pre>
240  */
242  /** mandatory [6..3200] x 1.25ms */
243  const uint16_t minConnectionInterval;
244  /** mandatory [6..3200] x 1.25ms and >= minConnectionInterval */
245  const uint16_t maxConnectionInterval;
246  /** mandatory [1..1000] */
247  const uint16_t slaveLatency;
248  /** mandatory [10..3200] */
250 
251  static std::shared_ptr<GattPeriphalPreferredConnectionParameters> get(const TROOctets &source) noexcept;
252 
254 
255  std::string toString() const noexcept;
256 };
257 
258 /**
259  * <i>Generic Access Service</i> is a mandatory GATT service all peripherals are required to implement. (FIXME: Add reference)
260  * <pre>
261  * https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.generic_access.xml
262  * </pre>
263  */
265  public:
266  /** Characteristic: Mandatory [Read: Mandatory; Write: Optional; ...]*/
267  const std::string deviceName;
268  /** Characteristic: Mandatory [Read: Mandatory; Write: Excluded; ...]*/
270  /** Characteristic: Optional [Read: Mandatory; Write: Conditional; ...]*/
271  const std::string peripheralPrivacyFlag; // FIXME: Value
272  /** Characteristic: Conditional [Read: Excluded; Write: Mandatory; ...]*/
273  const std::string reconnectionAdress; // FIXME: Value
274  /** Characteristic: Optional [Read: Mandatory; Write: Excluded; ...]*/
275  const std::shared_ptr<GattPeriphalPreferredConnectionParameters> prefConnParam;
276 
277  GattGenericAccessSvc(const std::string & deviceName_, const AppearanceCat appearance_,
278  const std::shared_ptr<GattPeriphalPreferredConnectionParameters> & prefConnParam_) noexcept
279  : deviceName(deviceName_), appearance(appearance_), prefConnParam(prefConnParam_) {}
280 
281  std::string toString() const noexcept;
282 };
283 
284 /**
285  * <i>PnP ID</i> is a GATT Characteristic.
286  * <pre>
287  * https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.pnp_id.xml
288  * </pre>
289  */
290 struct GattPnP_ID {
291  const uint8_t vendor_id_source;
292  const uint16_t vendor_id;
293  const uint16_t product_id;
294  const uint16_t product_version;
295 
296  static std::shared_ptr<GattPnP_ID> get(const TROOctets &source) noexcept;
297 
298  GattPnP_ID() noexcept
299  : vendor_id_source(0), vendor_id(0), product_id(0), product_version(0) {}
300 
301  GattPnP_ID(const TROOctets &source) noexcept;
302 
303  GattPnP_ID(const uint8_t vendor_id_source_, const uint16_t vendor_id_, const uint16_t product_id_, const uint16_t product_version_) noexcept
304  : vendor_id_source(vendor_id_source_), vendor_id(vendor_id_), product_id(product_id_), product_version(product_version_) {}
305 
306  std::string toString() const noexcept;
307 };
308 
309 /**
310  * <i>Device Information</i> is a GATT service.
311  * <pre>
312  * https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.device_information.xml
313  * </pre>
314  */
316  public:
317  /** Optional */
319  /** Optional */
320  const std::string modelNumber;
321  /** Optional */
322  const std::string serialNumber;
323  /** Optional */
324  const std::string firmwareRevision;
325  /** Optional */
326  const std::string hardwareRevision;
327  /** Optional */
328  const std::string softwareRevision;
329  /** Optional */
330  const std::string manufacturer;
331  /** Optional */
333  /** Optional */
334  const std::shared_ptr<GattPnP_ID> pnpID;
335 
336  GattDeviceInformationSvc(const POctets &systemID_, const std::string &modelNumber_, const std::string &serialNumber_,
337  const std::string &firmwareRevision_, const std::string &hardwareRevision_, const std::string &softwareRevision_,
338  const std::string &manufacturer_, const POctets &regulatoryCertDataList_, const std::shared_ptr<GattPnP_ID> &pnpID_) noexcept
339  : systemID(systemID_), modelNumber(modelNumber_), serialNumber(serialNumber_), firmwareRevision(firmwareRevision_),
340  hardwareRevision(hardwareRevision_), softwareRevision(softwareRevision_), manufacturer(manufacturer_),
341  regulatoryCertDataList(regulatoryCertDataList_), pnpID(pnpID_) {}
342 
343  std::string toString() const noexcept;
344 };
345 
346 /** https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.battery_service.xml */
348  // TODO
349 };
350 
351 /** https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.temperature_measurement.xml */
353  public:
354  enum Bits : uint8_t {
355  /** bit 0: If set, temperature is in Fahrenheit, otherwise Celsius. */
356  IS_TEMP_FAHRENHEIT = 1,
357  /** bit 1: If set, timestamp field present, otherwise not.. */
358  HAS_TIMESTAMP = 2,
359  /** bit 2: If set, temperature type field present, otherwise not.. */
360  HAS_TEMP_TYPE = 4
361  };
362  /** Bitfields of Bits. 1 byte. */
363  const uint8_t flags;
364 
365  /** In Celsius if IS_TEMP_FAHRENHEIT is set, otherwise Fahrenheit. 4 bytes. */
366  const float temperatureValue;
367 
368  /** Timestamp, if HAS_TIMESTAMP is set. 7 bytes(!?) here w/o fractions. */
370 
371  /** Temperature Type, if HAS_TEMP_TYPE is set: Format ????. 1 byte (!?). */
372  const uint8_t temperature_type;
373 
374  static std::shared_ptr<GattTemperatureMeasurement> get(const TROOctets &source) noexcept;
375 
376  static std::shared_ptr<GattTemperatureMeasurement> get(const TOctetSlice &source) noexcept {
377  const TROOctets o(source.get_ptr(0), source.getSize());
378  return get(o);
379  }
380 
381  GattTemperatureMeasurement(const uint8_t flags_, const float temperatureValue_,
382  const ieee11073::AbsoluteTime &timestamp_, const uint8_t temperature_type_) noexcept
383  : flags(flags_), temperatureValue(temperatureValue_), timestamp(timestamp_), temperature_type(temperature_type_) {}
384 
385  bool isFahrenheit() const noexcept { return 0 != ( flags & Bits::IS_TEMP_FAHRENHEIT ); }
386  bool hasTimestamp() const noexcept { return 0 != ( flags & Bits::HAS_TIMESTAMP ); }
387  bool hasTemperatureType() const noexcept { return 0 != ( flags & Bits::HAS_TEMP_TYPE ); }
388 
389  std::string toString() const noexcept;
390 };
391 
392 
393 /* Application error */
394 
395 #define ATT_ECODE_IO 0x80
396 #define ATT_ECODE_TIMEOUT 0x81
397 #define ATT_ECODE_ABORTED 0x82
398 
399 #define ATT_MAX_VALUE_LEN 512
400 #define ATT_DEFAULT_L2CAP_MTU 48
401 #define ATT_DEFAULT_LE_MTU 23
402 
403 /* Flags for Execute Write Request Operation */
404 
405 #define ATT_CANCEL_ALL_PREP_WRITES 0x00
406 #define ATT_WRITE_ALL_PREP_WRITES 0x01
407 
408 /* Find Information Response Formats */
409 
410 #define ATT_FIND_INFO_RESP_FMT_16BIT 0x01
411 #define ATT_FIND_INFO_RESP_FMT_128BIT 0x02
412 
413 } // namespace direct_bt
414 
415 #endif /* GATT_IOCTL_HPP_ */
direct_bt::GattTemperatureMeasurement::flags
const uint8_t flags
Bitfields of Bits.
Definition: GattNumbers.hpp:363
direct_bt::Notify
@ Notify
Definition: GattNumbers.hpp:135
direct_bt::GattCharacteristicPropertySpec::toString
std::string toString() const noexcept
Definition: GATTNumbers.cpp:284
direct_bt::GattDeviceInformationSvc::modelNumber
const std::string modelNumber
Optional.
Definition: GattNumbers.hpp:320
direct_bt::WriteWithAck
@ WriteWithAck
Definition: GattNumbers.hpp:134
direct_bt::Broadcast
@ Broadcast
Definition: GattNumbers.hpp:131
direct_bt::TEMPERATURE_FAHRENHEIT
@ TEMPERATURE_FAHRENHEIT
Definition: GattNumbers.hpp:103
direct_bt::GattDeviceInformationSvc::systemID
const POctets systemID
Optional.
Definition: GattNumbers.hpp:318
direct_bt::GattDeviceInformationSvc::GattDeviceInformationSvc
GattDeviceInformationSvc(const POctets &systemID_, const std::string &modelNumber_, const std::string &serialNumber_, const std::string &firmwareRevision_, const std::string &hardwareRevision_, const std::string &softwareRevision_, const std::string &manufacturer_, const POctets &regulatoryCertDataList_, const std::shared_ptr< GattPnP_ID > &pnpID_) noexcept
Definition: GattNumbers.hpp:336
direct_bt::GattServiceType
GattServiceType
GATT Service Type, each encapsulating a set of Characteristics.
Definition: GattNumbers.hpp:64
direct_bt::Read
@ Read
Definition: GattNumbers.hpp:132
direct_bt::FIRMWARE_REVISION_STRING
@ FIRMWARE_REVISION_STRING
Definition: GattNumbers.hpp:121
direct_bt::GattPnP_ID::vendor_id
const uint16_t vendor_id
Definition: GattNumbers.hpp:292
direct_bt::GattCharacteristicPropertyToString
std::string GattCharacteristicPropertyToString(const GattCharacteristicProperty v) noexcept
Definition: GATTNumbers.cpp:259
darray.hpp
direct_bt::GattBatteryServiceSvc
https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org....
Definition: GattNumbers.hpp:347
direct_bt::Optional
@ Optional
Definition: GattNumbers.hpp:149
direct_bt::MANUFACTURER_NAME_STRING
@ MANUFACTURER_NAME_STRING
Definition: GattNumbers.hpp:124
direct_bt::PERIPHERAL_PRIVACY_FLAG
@ PERIPHERAL_PRIVACY_FLAG
Definition: GattNumbers.hpp:94
direct_bt::MODEL_NUMBER_STRING
@ MODEL_NUMBER_STRING
Definition: GattNumbers.hpp:119
direct_bt::RECONNECTION_ADDRESS
@ RECONNECTION_ADDRESS
Definition: GattNumbers.hpp:95
direct_bt::GattPnP_ID
PnP ID is a GATT Characteristic.
Definition: GattNumbers.hpp:290
direct_bt::GattDeviceInformationSvc::regulatoryCertDataList
const POctets regulatoryCertDataList
Optional.
Definition: GattNumbers.hpp:332
direct_bt::WriteNoAck
@ WriteNoAck
Definition: GattNumbers.hpp:133
direct_bt::SOFTWARE_REVISION_STRING
@ SOFTWARE_REVISION_STRING
Definition: GattNumbers.hpp:123
direct_bt::GattCharacteristicSpec::AuthSignedWriteIdx
@ AuthSignedWriteIdx
Definition: GattNumbers.hpp:180
direct_bt::GattPeriphalPreferredConnectionParameters::slaveLatency
const uint16_t slaveLatency
mandatory [1..1000]
Definition: GattNumbers.hpp:247
direct_bt::GattTemperatureMeasurement::temperatureValue
const float temperatureValue
In Celsius if IS_TEMP_FAHRENHEIT is set, otherwise Fahrenheit.
Definition: GattNumbers.hpp:366
direct_bt::GattGenericAccessSvc::appearance
const AppearanceCat appearance
Characteristic: Mandatory [Read: Mandatory; Write: Excluded; ...].
Definition: GattNumbers.hpp:269
direct_bt::if_notify_or_indicate_supported
@ if_notify_or_indicate_supported
Definition: GattNumbers.hpp:152
direct_bt::GENERIC_ATTRIBUTE
@ GENERIC_ATTRIBUTE
The service allows receiving indications of changed services.
Definition: GattNumbers.hpp:68
direct_bt::PNP_ID
@ PNP_ID
Definition: GattNumbers.hpp:126
direct_bt::GattClientCharacteristicConfigSpec::writeWithAck
const GattCharacteristicPropertySpec writeWithAck
Definition: GattNumbers.hpp:167
direct_bt::GattCharacteristicPropertySpec
Definition: GattNumbers.hpp:157
direct_bt::SYSTEM_ID
@ SYSTEM_ID
Mandatory: uint40.
Definition: GattNumbers.hpp:118
direct_bt
Definition: ATTPDUTypes.hpp:171
direct_bt::findGattCharSpec
const GattCharacteristicSpec * findGattCharSpec(const uint16_t uuid16) noexcept
Find the GattCharacteristicSpec entry by given uuid16, denominating either a GattCharacteristicType.
Definition: GATTNumbers.cpp:332
direct_bt::GattPeriphalPreferredConnectionParameters::connectionSupervisionTimeoutMultiplier
const uint16_t connectionSupervisionTimeoutMultiplier
mandatory [10..3200]
Definition: GattNumbers.hpp:249
direct_bt::GattServiceCharacteristic
Definition: GattNumbers.hpp:195
direct_bt::GattCharacteristicTypeToString
std::string GattCharacteristicTypeToString(const GattCharacteristicType v) noexcept
Definition: GATTNumbers.cpp:239
direct_bt::GattRequirementSpec
GattRequirementSpec
Definition: GattNumbers.hpp:146
direct_bt::GattGenericAccessSvc::deviceName
const std::string deviceName
Characteristic: Mandatory [Read: Mandatory; Write: Optional; ...].
Definition: GattNumbers.hpp:267
direct_bt::GattCharacteristicSpec::WriteWithAckIdx
@ WriteWithAckIdx
Definition: GattNumbers.hpp:179
jau
Definition: basic_algos.hpp:34
direct_bt::GattClientCharacteristicConfigSpec::requirement
const GattRequirementSpec requirement
Definition: GattNumbers.hpp:165
OctetTypes.hpp
direct_bt::GattGenericAccessSvc::peripheralPrivacyFlag
const std::string peripheralPrivacyFlag
Characteristic: Optional [Read: Mandatory; Write: Conditional; ...].
Definition: GattNumbers.hpp:271
direct_bt::GattPnP_ID::vendor_id_source
const uint8_t vendor_id_source
Definition: GattNumbers.hpp:291
GattCharacteristicType
GattCharacteristicType
Definition: test_datatype02.hpp:62
direct_bt::Indicate
@ Indicate
Definition: GattNumbers.hpp:136
direct_bt::GattTemperatureMeasurement::hasTemperatureType
bool hasTemperatureType() const noexcept
Definition: GattNumbers.hpp:387
direct_bt::GattCharacteristicType
GattCharacteristicType
GATT Assigned Characteristic Attribute Type for single logical value.
Definition: GattNumbers.hpp:88
direct_bt::GattCharacteristicProperty
GattCharacteristicProperty
Definition: GattNumbers.hpp:130
direct_bt::AuthSignedWrite
@ AuthSignedWrite
Definition: GattNumbers.hpp:137
direct_bt::GattPnP_ID::product_id
const uint16_t product_id
Definition: GattNumbers.hpp:293
jau::darray< GattCharacteristicPropertySpec >
direct_bt::IMMEDIATE_ALERT
@ IMMEDIATE_ALERT
This service exposes a control point to change the peripheral alert behavior.
Definition: GattNumbers.hpp:70
direct_bt::GattServiceCharacteristic::service
const GattServiceType service
Definition: GattNumbers.hpp:196
direct_bt::GattPeriphalPreferredConnectionParameters
Peripheral Preferred Connection Parameters is a GATT Characteristic.
Definition: GattNumbers.hpp:241
direct_bt::GattDeviceInformationSvc::hardwareRevision
const std::string hardwareRevision
Optional.
Definition: GattNumbers.hpp:326
direct_bt::GattCharacteristicSpec::characteristic
const GattCharacteristicType characteristic
Definition: GattNumbers.hpp:173
direct_bt::GattCharacteristicSpec
Definition: GattNumbers.hpp:172
direct_bt::INTERMEDIATE_TEMPERATURE
@ INTERMEDIATE_TEMPERATURE
Definition: GattNumbers.hpp:111
direct_bt::DEVICE_NAME
@ DEVICE_NAME
Definition: GattNumbers.hpp:92
direct_bt::MEASUREMENT_INTERVAL
@ MEASUREMENT_INTERVAL
Definition: GattNumbers.hpp:112
GattServiceType
GattServiceType
Definition: test_datatype02.hpp:44
direct_bt::GattCharacteristicSpec::NotifyIdx
@ NotifyIdx
Definition: GattNumbers.hpp:182
direct_bt::PERIPHERAL_PREFERRED_CONNECTION_PARAMETERS
@ PERIPHERAL_PREFERRED_CONNECTION_PARAMETERS
Definition: GattNumbers.hpp:96
direct_bt::GattPnP_ID::product_version
const uint16_t product_version
Definition: GattNumbers.hpp:294
direct_bt::GattGenericAccessSvc
Generic Access Service is a mandatory GATT service all peripherals are required to implement.
Definition: GattNumbers.hpp:264
direct_bt::GattPnP_ID::GattPnP_ID
GattPnP_ID(const uint8_t vendor_id_source_, const uint16_t vendor_id_, const uint16_t product_id_, const uint16_t product_version_) noexcept
Definition: GattNumbers.hpp:303
direct_bt::GattTemperatureMeasurement::timestamp
const ieee11073::AbsoluteTime timestamp
Timestamp, if HAS_TIMESTAMP is set.
Definition: GattNumbers.hpp:369
direct_bt::GattGenericAccessSvc::reconnectionAdress
const std::string reconnectionAdress
Characteristic: Conditional [Read: Excluded; Write: Mandatory; ...].
Definition: GattNumbers.hpp:273
direct_bt::GENERIC_ACCESS
@ GENERIC_ACCESS
This service contains generic information about the device.
Definition: GattNumbers.hpp:66
direct_bt::GattPnP_ID::GattPnP_ID
GattPnP_ID() noexcept
Definition: GattNumbers.hpp:298
direct_bt::GattTemperatureMeasurement
https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org....
Definition: GattNumbers.hpp:352
direct_bt::LINK_LOSS
@ LINK_LOSS
The service defines behavior on the device when a link is lost between two devices.
Definition: GattNumbers.hpp:72
direct_bt::GattCharacteristicSpec::requirement
const GattRequirementSpec requirement
Definition: GattNumbers.hpp:174
direct_bt::REGULATORY_CERT_DATA_LIST
@ REGULATORY_CERT_DATA_LIST
Definition: GattNumbers.hpp:125
direct_bt::BTSecurityRegistry::get
Entry * get(const EUI48 &addr, const std::string &name, AddressNameEntryMatchFunc m) noexcept
Returns a matching BTSecurityRegistry::Entry with the given.
Definition: BTSecurityRegistry.cpp:36
direct_bt::findGattServiceChar
const GattServiceCharacteristic * findGattServiceChar(const uint16_t uuid16) noexcept
Find the GattServiceCharacteristic entry by given uuid16, denominating either a GattServiceType or Ga...
Definition: GATTNumbers.cpp:316
direct_bt::DEVICE_INFORMATION
@ DEVICE_INFORMATION
This service exposes manufacturer and/or vendor information about a device.
Definition: GattNumbers.hpp:76
BTTypes0.hpp
direct_bt::GattTemperatureMeasurement::temperature_type
const uint8_t temperature_type
Temperature Type, if HAS_TEMP_TYPE is set: Format ????.
Definition: GattNumbers.hpp:372
UUID.hpp
direct_bt::if_characteristic_supported
@ if_characteristic_supported
Definition: GattNumbers.hpp:151
direct_bt::SERIAL_NUMBER_STRING
@ SERIAL_NUMBER_STRING
Definition: GattNumbers.hpp:120
direct_bt::BATTERY_SERVICE
@ BATTERY_SERVICE
This service exposes the state of a battery within a device.
Definition: GattNumbers.hpp:78
direct_bt::GattClientCharacteristicConfigSpec
Definition: GattNumbers.hpp:164
direct_bt::GattDeviceInformationSvc::pnpID
const std::shared_ptr< GattPnP_ID > pnpID
Optional.
Definition: GattNumbers.hpp:334
direct_bt::GattCharacteristicSpec::propertySpec
const jau::darray< GattCharacteristicPropertySpec > propertySpec
Aggregated in PropertySpecIdx order.
Definition: GattNumbers.hpp:188
direct_bt::AppearanceCat
AppearanceCat
Definition: BTTypes0.hpp:637
direct_bt::GattDeviceInformationSvc::manufacturer
const std::string manufacturer
Optional.
Definition: GattNumbers.hpp:330
direct_bt::GattTemperatureMeasurement::isFahrenheit
bool isFahrenheit() const noexcept
Definition: GattNumbers.hpp:385
direct_bt::Excluded
@ Excluded
Definition: GattNumbers.hpp:147
direct_bt::TEMPERATURE_MEASUREMENT
@ TEMPERATURE_MEASUREMENT
Definition: GattNumbers.hpp:108
direct_bt::Conditional
@ Conditional
Definition: GattNumbers.hpp:150
direct_bt::GattGenericAccessSvc::prefConnParam
const std::shared_ptr< GattPeriphalPreferredConnectionParameters > prefConnParam
Characteristic: Optional [Read: Mandatory; Write: Excluded; ...].
Definition: GattNumbers.hpp:275
direct_bt::GattDeviceInformationSvc::serialNumber
const std::string serialNumber
Optional.
Definition: GattNumbers.hpp:322
direct_bt::GATT_HEALTH_THERMOMETER_SRVC
const GattServiceCharacteristic GATT_HEALTH_THERMOMETER_SRVC
https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org....
Definition: GATTNumbers.cpp:86
direct_bt::TROOctets
Transient read only octet data, i.e.
Definition: OctetTypes.hpp:59
direct_bt::GattCharacteristicSpec::ReliableWriteExtIdx
@ ReliableWriteExtIdx
Definition: GattNumbers.hpp:181
direct_bt::HARDWARE_REVISION_STRING
@ HARDWARE_REVISION_STRING
Definition: GattNumbers.hpp:122
direct_bt::GattPeriphalPreferredConnectionParameters::maxConnectionInterval
const uint16_t maxConnectionInterval
mandatory [6..3200] x 1.25ms and >= minConnectionInterval
Definition: GattNumbers.hpp:245
GattRequirementSpec
GattRequirementSpec
Definition: test_datatype02.hpp:120
direct_bt::GattPeriphalPreferredConnectionParameters::minConnectionInterval
const uint16_t minConnectionInterval
mandatory [6..3200] x 1.25ms
Definition: GattNumbers.hpp:243
direct_bt::GattTemperatureMeasurement::get
static std::shared_ptr< GattTemperatureMeasurement > get(const TOctetSlice &source) noexcept
Definition: GattNumbers.hpp:376
direct_bt::GATT_SERVICES
const jau::darray< const GattServiceCharacteristic * > GATT_SERVICES
Definition: GATTNumbers.cpp:196
direct_bt::GattCharacteristicPropertySpec::requirement
const GattRequirementSpec requirement
Definition: GattNumbers.hpp:159
DataTypes.hpp
ieee11073::AbsoluteTime
date / timestamp format
Definition: DataTypes.hpp:73
direct_bt::GattServiceCharacteristic::characteristics
const jau::darray< GattCharacteristicSpec > characteristics
Definition: GattNumbers.hpp:197
direct_bt::TOctetSlice
Definition: OctetTypes.hpp:399
direct_bt::GattNameToString
std::string GattNameToString(const TROOctets &v) noexcept
Converts a GATT Name (not null-terminated) UTF8 to a null-terminated C++ string.
Definition: GATTNumbers.cpp:349
direct_bt::GATT_DEVICE_INFORMATION_SRVC
const GattServiceCharacteristic GATT_DEVICE_INFORMATION_SRVC
Definition: GATTNumbers.cpp:121
direct_bt::GattDeviceInformationSvc
Device Information is a GATT service.
Definition: GattNumbers.hpp:315
direct_bt::GattTemperatureMeasurement::Bits
Bits
Definition: GattNumbers.hpp:354
direct_bt::GattCharacteristicSpec::WriteNoAckIdx
@ WriteNoAckIdx
Definition: GattNumbers.hpp:178
direct_bt::ExtProps
@ ExtProps
Definition: GattNumbers.hpp:138
direct_bt::TEMPERATURE_CELSIUS
@ TEMPERATURE_CELSIUS
Mandatory: sint16 10^-1: Celsius.
Definition: GattNumbers.hpp:102
direct_bt::TEMPERATURE
@ TEMPERATURE
Mandatory: sint16 10^-2: Celsius.
Definition: GattNumbers.hpp:99
direct_bt::GattDeviceInformationSvc::softwareRevision
const std::string softwareRevision
Optional.
Definition: GattNumbers.hpp:328
direct_bt::Mandatory
@ Mandatory
Definition: GattNumbers.hpp:148
basic_types.hpp
direct_bt::GattRequirementSpecToString
std::string GattRequirementSpecToString(const GattRequirementSpec v) noexcept
Definition: GATTNumbers.cpp:276
direct_bt::C1
@ C1
Definition: GattNumbers.hpp:153
direct_bt::GattCharacteristicSpec::IndicateIdx
@ IndicateIdx
Definition: GattNumbers.hpp:183
direct_bt::GattServiceTypeToString
std::string GattServiceTypeToString(const GattServiceType v) noexcept
Definition: GATTNumbers.cpp:207
direct_bt::POctets
Persistent octet data, i.e.
Definition: OctetTypes.hpp:451
direct_bt::GattGenericAccessSvc::GattGenericAccessSvc
GattGenericAccessSvc(const std::string &deviceName_, const AppearanceCat appearance_, const std::shared_ptr< GattPeriphalPreferredConnectionParameters > &prefConnParam_) noexcept
Definition: GattNumbers.hpp:277
direct_bt::GattCharacteristicSpec::clientConfig
const GattClientCharacteristicConfigSpec clientConfig
Definition: GattNumbers.hpp:190
direct_bt::TEMPERATURE_TYPE
@ TEMPERATURE_TYPE
Mandatory: 8bit: 1 armpit, 2 body (general), 3(ear), 4 (finger), ...
Definition: GattNumbers.hpp:110
direct_bt::ReliableWriteExt
@ ReliableWriteExt
FIXME: extension?
Definition: GattNumbers.hpp:140
direct_bt::AuxWriteExt
@ AuxWriteExt
FIXME: extension?
Definition: GattNumbers.hpp:142
direct_bt::HEALTH_THERMOMETER
@ HEALTH_THERMOMETER
This service exposes temperature and other data from a thermometer intended for healthcare and fitnes...
Definition: GattNumbers.hpp:74
direct_bt::GattDeviceInformationSvc::firmwareRevision
const std::string firmwareRevision
Optional.
Definition: GattNumbers.hpp:324
direct_bt::APPEARANCE
@ APPEARANCE
Definition: GattNumbers.hpp:93
direct_bt::GattTemperatureMeasurement::GattTemperatureMeasurement
GattTemperatureMeasurement(const uint8_t flags_, const float temperatureValue_, const ieee11073::AbsoluteTime &timestamp_, const uint8_t temperature_type_) noexcept
Definition: GattNumbers.hpp:381
direct_bt::GattCharacteristicSpec::PropertySpecIdx
PropertySpecIdx
Definition: GattNumbers.hpp:176
GattCharacteristicProperty
GattCharacteristicProperty
Definition: test_datatype02.hpp:104
direct_bt::GattClientCharacteristicConfigSpec::read
const GattCharacteristicPropertySpec read
Definition: GattNumbers.hpp:166
direct_bt::GattCharacteristicSpec::AuxWriteExtIdx
@ AuxWriteExtIdx
Definition: GattNumbers.hpp:184
direct_bt::GattCharacteristicPropertySpec::property
const GattCharacteristicProperty property
Definition: GattNumbers.hpp:158
direct_bt::GATT_GENERIC_ACCESS_SRVC
const GattServiceCharacteristic GATT_GENERIC_ACCESS_SRVC
Intentionally ease compile and linker burden by using 'extern' instead of 'inline',...
Definition: GATTNumbers.cpp:42
direct_bt::GattTemperatureMeasurement::hasTimestamp
bool hasTimestamp() const noexcept
Definition: GattNumbers.hpp:386