Function AddCharacteristic

Synopsis

#include <bta/gatt/database_builder.h>

void AddCharacteristic(uint16_t handle, uint16_t value_handle, const bluetooth::Uuid &uuid, uint8_t properties)

Description

No description yet.

Source

Lines 80-99 in bta/gatt/database_builder.cc. Line 37 in bta/gatt/database_builder.h.

void DatabaseBuilder::AddCharacteristic(uint16_t handle, uint16_t value_handle,
                                        const Uuid& uuid, uint8_t properties) {
  Service* service = FindService(database.services, handle);
  if (!service) {
    LOG(ERROR) << "Illegal action to add to non-existing service!";
    return;
  }

  if (service->end_handle < value_handle)
    LOG(WARNING) << "Remote device violates spec: value_handle="
                 << loghex(value_handle) << " is after service end_handle="
                 << loghex(service->end_handle);

  service->characteristics.emplace_back(
      Characteristic{.declaration_handle = handle,
                     .value_handle = value_handle,
                     .properties = properties,
                     .uuid = uuid});
  return;
}





Add Discussion as Guest

Log in to DocsForge