Skip to content

Commit

Permalink
pw_bluetooth_sapphire: Embossify another packed struct definition
Browse files Browse the repository at this point in the history
Remove the definition of
LEReadNumSupportedAdvertisingSetsReturnParams and replace all
uses with references to emboss-generated definitions
(LEReadNumberOfSupportedAdvertisingSetsCommandCompleteEvent).

Bug: b/42167863
Test: pw presubmit --step gn_chre_googletest_nanopb_sapphire_build
Change-Id: I913a9c843d778d902100fce61c30a848ef3ebb1a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/245253
Commit-Queue: Josh Conner <[email protected]>
Docs-Not-Needed: Josh Conner <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Faraaz Sareshwala <[email protected]>
  • Loading branch information
josh-conner authored and CQ Bot Account committed Oct 29, 2024
1 parent 3a9886b commit 9e54847
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
11 changes: 7 additions & 4 deletions pw_bluetooth_sapphire/host/testing/fake_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3336,11 +3336,14 @@ void FakeController::OnLEReadMaximumAdvertisingDataLength() {
}

void FakeController::OnLEReadNumberOfSupportedAdvertisingSets() {
hci_spec::LEReadNumSupportedAdvertisingSetsReturnParams params;
params.status = pwemb::StatusCode::SUCCESS;
params.num_supported_adv_sets = num_supported_advertising_sets_;
auto event = hci::EmbossEventPacket::New<
pwemb::LEReadNumberOfSupportedAdvertisingSetsCommandCompleteEventWriter>(
hci_spec::kCommandCompleteEventCode);
auto view = event.view_t();
view.status().Write(pwemb::StatusCode::SUCCESS);
view.num_supported_advertising_sets().Write(num_supported_advertising_sets_);
RespondWithCommandComplete(hci_spec::kLEReadNumSupportedAdvertisingSets,
BufferView(&params, sizeof(params)));
&event);
}

void FakeController::OnLERemoveAdvertisingSet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1029,13 +1029,6 @@ constexpr OpCode kLEReadMaximumAdvertisingDataLength =
constexpr OpCode kLEReadNumSupportedAdvertisingSets =
LEControllerCommandOpCode(0x003B);

struct LEReadNumSupportedAdvertisingSetsReturnParams {
// See enum StatusCode in hci_constants.h.
StatusCode status;

uint8_t num_supported_adv_sets;
} __attribute__((packed));

// =============================================
// LE Remove Advertising Set Command (v5.0) (LE)
constexpr OpCode kLERemoveAdvertisingSet = LEControllerCommandOpCode(0x003C);
Expand Down

0 comments on commit 9e54847

Please sign in to comment.