Function AddIncludedService

Synopsis

#include <bta/gatt/database_builder.h>

void AddIncludedService(uint16_t handle, const bluetooth::Uuid &uuid, uint16_t start_handle, uint16_t end_handle)

Description

No description yet.

Source

Lines 57-78 in bta/gatt/database_builder.cc. Line 35 in bta/gatt/database_builder.h.

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

  /* We discover all Primary Services first. If included service was not seen
   * before, it must be a Secondary Service */
  if (!FindService(database.services, start_handle)) {
    AddService(start_handle, end_handle, uuid, false /* not primary */);
  }

  service->included_services.push_back(IncludedService{
      .handle = handle,
      .uuid = uuid,
      .start_handle = start_handle,
      .end_handle = end_handle,
  });
}





Add Discussion as Guest

Log in to DocsForge