Function OnConnected

Synopsis

#include <bta/av/bta_av_int.h>

void OnConnected(const RawAddress &peer_address)

Description

Called to setup the state when connected to a peer.

Parameters:

peer_address - the peer address

Source

Lines 370-389 in bta/av/bta_av_main.cc. Line 523 in bta/av/bta_av_int.h.

void tBTA_AV_SCB::OnConnected(const RawAddress& peer_address) {
  peer_address_ = peer_address;

  if (peer_address.IsEmpty()) {
    LOG_ERROR(LOG_TAG, "%s: Invalid peer address: %s", __func__,
              peer_address.ToString().c_str());
    return;
  }

  // Read and restore the AVDTP version from local storage
  uint16_t avdtp_version = 0;
  size_t version_value_size = sizeof(avdtp_version);
  if (!btif_config_get_bin(peer_address_.ToString(), AVDTP_VERSION_CONFIG_KEY,
                           (uint8_t*)&avdtp_version, &version_value_size)) {
    LOG_WARN(LOG_TAG, "%s: Failed to read cached peer AVDTP version for %s",
             __func__, peer_address_.ToString().c_str());
  } else {
    SetAvdtpVersion(avdtp_version);
  }
}





Add Discussion as Guest

Log in to DocsForge