Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
Go to the documentation of this file.
26 #ifndef GATT_NUMBERS_HPP_
27 #define GATT_NUMBERS_HPP_
161 std::string
toString() const noexcept;
169 std::string
toString() const noexcept;
192 std::string
toString() const noexcept;
199 std::string
toString() const noexcept;
251 static std::shared_ptr<GattPeriphalPreferredConnectionParameters>
get(
const TROOctets &source) noexcept;
255 std::string
toString() const noexcept;
275 const std::shared_ptr<GattPeriphalPreferredConnectionParameters>
prefConnParam;
278 const std::shared_ptr<GattPeriphalPreferredConnectionParameters> & prefConnParam_) noexcept
279 : deviceName(deviceName_), appearance(appearance_), prefConnParam(prefConnParam_) {}
281 std::string
toString() const noexcept;
296 static std::shared_ptr<GattPnP_ID>
get(
const TROOctets &source) noexcept;
299 : vendor_id_source(0), vendor_id(0), product_id(0), product_version(0) {}
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_) {}
306 std::string
toString() const noexcept;
334 const std::shared_ptr<GattPnP_ID>
pnpID;
337 const std::string &firmwareRevision_,
const std::string &hardwareRevision_,
const std::string &softwareRevision_,
338 const std::string &manufacturer_,
const POctets ®ulatoryCertDataList_,
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_) {}
343 std::string
toString() const noexcept;
356 IS_TEMP_FAHRENHEIT = 1,
374 static std::shared_ptr<GattTemperatureMeasurement>
get(
const TROOctets &source) noexcept;
376 static std::shared_ptr<GattTemperatureMeasurement>
get(
const TOctetSlice &source) noexcept {
377 const TROOctets o(source.get_ptr(0), source.getSize());
383 : flags(flags_), temperatureValue(temperatureValue_), timestamp(timestamp_), temperature_type(temperature_type_) {}
385 bool isFahrenheit() const noexcept {
return 0 != ( flags & Bits::IS_TEMP_FAHRENHEIT ); }
386 bool hasTimestamp() const noexcept {
return 0 != ( flags & Bits::HAS_TIMESTAMP ); }
389 std::string
toString() const noexcept;
395 #define ATT_ECODE_IO 0x80
396 #define ATT_ECODE_TIMEOUT 0x81
397 #define ATT_ECODE_ABORTED 0x82
399 #define ATT_MAX_VALUE_LEN 512
400 #define ATT_DEFAULT_L2CAP_MTU 48
401 #define ATT_DEFAULT_LE_MTU 23
405 #define ATT_CANCEL_ALL_PREP_WRITES 0x00
406 #define ATT_WRITE_ALL_PREP_WRITES 0x01
410 #define ATT_FIND_INFO_RESP_FMT_16BIT 0x01
411 #define ATT_FIND_INFO_RESP_FMT_128BIT 0x02
const uint8_t flags
Bitfields of Bits.
std::string toString() const noexcept
GattServiceType
GATT Service Type, each encapsulating a set of Characteristics.
@ FIRMWARE_REVISION_STRING
std::string GattCharacteristicPropertyToString(const GattCharacteristicProperty v) noexcept
https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org....
@ MANUFACTURER_NAME_STRING
@ PERIPHERAL_PRIVACY_FLAG
PnP ID is a GATT Characteristic.
@ SOFTWARE_REVISION_STRING
const uint16_t slaveLatency
mandatory [1..1000]
const float temperatureValue
In Celsius if IS_TEMP_FAHRENHEIT is set, otherwise Fahrenheit.
const AppearanceCat appearance
Characteristic: Mandatory [Read: Mandatory; Write: Excluded; ...].
@ if_notify_or_indicate_supported
@ GENERIC_ATTRIBUTE
The service allows receiving indications of changed services.
const GattCharacteristicPropertySpec writeWithAck
@ SYSTEM_ID
Mandatory: uint40.
const GattCharacteristicSpec * findGattCharSpec(const uint16_t uuid16) noexcept
Find the GattCharacteristicSpec entry by given uuid16, denominating either a GattCharacteristicType.
const uint16_t connectionSupervisionTimeoutMultiplier
mandatory [10..3200]
std::string GattCharacteristicTypeToString(const GattCharacteristicType v) noexcept
const std::string deviceName
Characteristic: Mandatory [Read: Mandatory; Write: Optional; ...].
const GattRequirementSpec requirement
const std::string peripheralPrivacyFlag
Characteristic: Optional [Read: Mandatory; Write: Conditional; ...].
const uint8_t vendor_id_source
bool hasTemperatureType() const noexcept
GattCharacteristicType
GATT Assigned Characteristic Attribute Type for single logical value.
GattCharacteristicProperty
const uint16_t product_id
@ IMMEDIATE_ALERT
This service exposes a control point to change the peripheral alert behavior.
const GattServiceType service
Peripheral Preferred Connection Parameters is a GATT Characteristic.
const GattCharacteristicType characteristic
@ INTERMEDIATE_TEMPERATURE
@ PERIPHERAL_PREFERRED_CONNECTION_PARAMETERS
const uint16_t product_version
Generic Access Service is a mandatory GATT service all peripherals are required to implement.
GattPnP_ID(const uint8_t vendor_id_source_, const uint16_t vendor_id_, const uint16_t product_id_, const uint16_t product_version_) noexcept
const ieee11073::AbsoluteTime timestamp
Timestamp, if HAS_TIMESTAMP is set.
const std::string reconnectionAdress
Characteristic: Conditional [Read: Excluded; Write: Mandatory; ...].
@ GENERIC_ACCESS
This service contains generic information about the device.
https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org....
@ LINK_LOSS
The service defines behavior on the device when a link is lost between two devices.
const GattRequirementSpec requirement
@ REGULATORY_CERT_DATA_LIST
Entry * get(const EUI48 &addr, const std::string &name, AddressNameEntryMatchFunc m) noexcept
Returns a matching BTSecurityRegistry::Entry with the given.
const GattServiceCharacteristic * findGattServiceChar(const uint16_t uuid16) noexcept
Find the GattServiceCharacteristic entry by given uuid16, denominating either a GattServiceType or Ga...
@ DEVICE_INFORMATION
This service exposes manufacturer and/or vendor information about a device.
const uint8_t temperature_type
Temperature Type, if HAS_TEMP_TYPE is set: Format ????.
@ if_characteristic_supported
@ BATTERY_SERVICE
This service exposes the state of a battery within a device.
const jau::darray< GattCharacteristicPropertySpec > propertySpec
Aggregated in PropertySpecIdx order.
bool isFahrenheit() const noexcept
@ TEMPERATURE_MEASUREMENT
const std::shared_ptr< GattPeriphalPreferredConnectionParameters > prefConnParam
Characteristic: Optional [Read: Mandatory; Write: Excluded; ...].
const GattServiceCharacteristic GATT_HEALTH_THERMOMETER_SRVC
https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org....
Transient read only octet data, i.e.
@ HARDWARE_REVISION_STRING
const uint16_t maxConnectionInterval
mandatory [6..3200] x 1.25ms and >= minConnectionInterval
const uint16_t minConnectionInterval
mandatory [6..3200] x 1.25ms
static std::shared_ptr< GattTemperatureMeasurement > get(const TOctetSlice &source) noexcept
const jau::darray< const GattServiceCharacteristic * > GATT_SERVICES
const GattRequirementSpec requirement
const jau::darray< GattCharacteristicSpec > characteristics
std::string GattNameToString(const TROOctets &v) noexcept
Converts a GATT Name (not null-terminated) UTF8 to a null-terminated C++ string.
const GattServiceCharacteristic GATT_DEVICE_INFORMATION_SRVC
@ TEMPERATURE_CELSIUS
Mandatory: sint16 10^-1: Celsius.
@ TEMPERATURE
Mandatory: sint16 10^-2: Celsius.
std::string GattRequirementSpecToString(const GattRequirementSpec v) noexcept
std::string GattServiceTypeToString(const GattServiceType v) noexcept
Persistent octet data, i.e.
GattGenericAccessSvc(const std::string &deviceName_, const AppearanceCat appearance_, const std::shared_ptr< GattPeriphalPreferredConnectionParameters > &prefConnParam_) noexcept
const GattClientCharacteristicConfigSpec clientConfig
@ TEMPERATURE_TYPE
Mandatory: 8bit: 1 armpit, 2 body (general), 3(ear), 4 (finger), ...
@ ReliableWriteExt
FIXME: extension?
@ AuxWriteExt
FIXME: extension?
@ HEALTH_THERMOMETER
This service exposes temperature and other data from a thermometer intended for healthcare and fitnes...
GattTemperatureMeasurement(const uint8_t flags_, const float temperatureValue_, const ieee11073::AbsoluteTime ×tamp_, const uint8_t temperature_type_) noexcept
GattCharacteristicProperty
const GattCharacteristicPropertySpec read
const GattCharacteristicProperty property
const GattServiceCharacteristic GATT_GENERIC_ACCESS_SRVC
Intentionally ease compile and linker burden by using 'extern' instead of 'inline',...
bool hasTimestamp() const noexcept