Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 353b6cdb authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

vc: Store and add description to dumpsys

Bug: 331775328
Flag: EXEMPT, regression tested with unit tests
Test: atest bluetooth_vc_test
Change-Id: I9a0e1fb30c1e56c3034b2b5fa5d2348419a69940
parent 4355f46e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ struct VolumeOffset {
  uint8_t change_counter;
  int16_t offset;
  uint32_t location;
  std::string description;
  uint16_t service_handle;
  uint16_t state_handle;
  uint16_t state_ccc_handle;
@@ -138,6 +139,7 @@ struct VolumeOffset {
        change_counter(0),
        offset(0),
        location(0),
        description(""),
        service_handle(service_handle),
        state_handle(0),
        state_ccc_handle(0),
@@ -190,12 +192,12 @@ public:
    int n = Size();
    stream << "     == number of offsets: " << n << " == \n";

    for (int i = 0; i < n; i++) {
      auto v = volume_offsets[i];
    for (auto const v : volume_offsets) {
      stream << "   id: " << +v.id << "\n"
             << "    offset: " << +v.offset << "\n"
             << "    changeCnt: " << +v.change_counter << "\n"
             << "    location: " << +v.location << "\n"
             << "    description: " << v.description << "\n"
             << "    service_handle: " << +v.service_handle << "\n"
             << "    audio_location_writable " << v.audio_location_writable << "\n"
             << "    audio_descr_writable: " << v.audio_descr_writable << "\n";
+5 −2
Original line number Diff line number Diff line
@@ -563,7 +563,10 @@ public:
                                 uint8_t* value) {
    std::string description = std::string(value, value + len);
    if (!base::IsStringUTF8(description)) {
      description = "<invalid utf8 string>";
      bluetooth::log::error(" Received description is no utf8 string for {}, offset id={:#x}",
                            device->address, offset->id);
    } else {
      offset->description = description;
    }

    bluetooth::log::info("{}, {}", device->address, description);
@@ -573,7 +576,7 @@ public:
      return;
    }

    callbacks_->OnExtAudioOutDescriptionChanged(device->address, offset->id, description);
    callbacks_->OnExtAudioOutDescriptionChanged(device->address, offset->id, offset->description);
  }

  void OnGattWriteCcc(uint16_t connection_id, tGATT_STATUS status, uint16_t handle, uint16_t len,