src/connectivity/wlan/drivers/third_party/broadcom/brcmfmac/sim/sim_fw.cc
std::unique_ptr<std::vector<uint8_t>> SimFirmware::CreateBcdcBuffer(size_t requested_size,
                                                                    size_t* offset_out) {
  size_t header_size = sizeof(brcmf_proto_bcdc_header);
  size_t total_size = header_size + requested_size;

  auto buf = std::make_unique<std::vector<uint8_t>>(total_size);
  auto header = reinterpret_cast<brcmf_proto_bcdc_header*>(buf->data());

  header->flags = (BCDC_PROTO_VER << BCDC_FLAG_VER_SHIFT) & BCDC_FLAG_VER_MASK;
  header->priority = 0xff & BCDC_PRIORITY_MASK;
  header->flags2 = 0;

  // Data immediately follows the header
  header->data_offset = 0;

  *offset_out = header_size;
  return buf;
}
// Returns a bufer that can be used for BCDC-formatted communications, with the requested
// payload size and an initialized BCDC header. "offset_out" represents the offset of the
// payload within the returned buffer.
Returns a bufer that can be used for BCDC-formatted communications, with the requested
payload size and an initialized BCDC header. "offset_out" represents the offset of the
payload within the returned buffer.
Returns a bufer that can be used for BCDC - formatted communications with the requested payload size and an initialized BCDC header . " offset_out " represents the offset of the payload within the returned buffer .
std::unique_ptr<std::vector<uint8_t>> SimFirmware::CreateBcdcBuffer(size_t requested_size,
                                                                    size_t* offset_out) {
  size_t header_size = sizeof(brcmf_proto_bcdc_header);
  size_t total_size = header_size + requested_size;
  auto buf = std::make_unique<std::vector<uint8_t>>(total_size);
  auto header = reinterpret_cast<brcmf_proto_bcdc_header*>(buf->data());
  header->flags = (BCDC_PROTO_VER << BCDC_FLAG_VER_SHIFT) & BCDC_FLAG_VER_MASK;
  header->priority = 0xff & BCDC_PRIORITY_MASK;
  header->flags2 = 0;
  header->data_offset = 0;
  *offset_out = header_size;
  return buf;
}
std :: unique_ptr < std :: vector < uint8_t > > SimFirmware :: CreateBcdcBuffer ( size_t requested_size , size_t * offset_out ) { size_t header_size = sizeof ( brcmf_proto_bcdc_header ) ; size_t total_size = header_size + requested_size ; auto buf = std :: make_unique < std :: vector < uint8_t > > ( total_size ) ; auto header = reinterpret_cast < brcmf_proto_bcdc_header * > ( buf -> data ( ) ) ; header -> flags = ( BCDC_PROTO_VER << BCDC_FLAG_VER_SHIFT ) & BCDC_FLAG_VER_MASK ; header -> priority = 0xff & BCDC_PRIORITY_MASK ; header -> flags2 = 0 ; header -> data_offset = 0 ; * offset_out = header_size ; return buf ; }
Returns a bufer that can be used for BCDC-formatted communications, with the requested
payload size and an initialized BCDC header.
Returns a bufer that can be used for BCDC - formatted communications with the requested payload size and an initialized BCDC header .
// Data immediately follows the header