Function ToString

Synopsis

#include <bta/gatt/database.h>

std::string ToString() const

Description

No description yet.

Source

Lines 51-79 in bta/gatt/database.cc. Line 109 in bta/gatt/database.h.

std::string Database::ToString() const {
  std::stringstream tmp;

  for (const Service& service : services) {
    tmp << "Service: handle=" << loghex(service.handle)
        << ", end_handle=" << loghex(service.end_handle)
        << ", uuid=" << service.uuid << "\n";

    for (const auto& is : service.included_services) {
      tmp << "\t Included service: handle=" << loghex(is.handle)
          << ", start_handle=" << loghex(is.start_handle)
          << ", end_handle=" << loghex(is.end_handle) << ", uuid=" << is.uuid
          << "\n";
    }

    for (const Characteristic& c : service.characteristics) {
      tmp << "\t Characteristic: declaration_handle="
          << loghex(c.declaration_handle)
          << ", value_handle=" << loghex(c.value_handle) << ", uuid=" << c.uuid
          << ", prop=" << loghex(c.properties) << "\n";

      for (const Descriptor& d : c.descriptors) {
        tmp << "\t\t Descriptor: handle=" << loghex(d.handle)
            << ", uuid=" << d.uuid << "\n";
      }
    }
  }
  return tmp.str();
}





Add Discussion as Guest

Log in to DocsForge