Skip to content

Commit

Permalink
pw_bluetooth_sapphire_mcuxpresso: Add support for raw HCI packets
Browse files Browse the repository at this point in the history
NXP SDK doesn't allow to get raw HCI packets without NXP bluetooth
stack. This commit registers custom UART callbacks and tasks to handle
HCI packets in pigweed itself.

Change-Id: Ib622570b42640b911f36251daed22ff0b3d57c6f
Signed-off-by: Kamil Rakoczy <[email protected]>
  • Loading branch information
kamilrakoczy committed Nov 26, 2024
1 parent 67adcdc commit 2fc5d06
Show file tree
Hide file tree
Showing 11 changed files with 407 additions and 237 deletions.
49 changes: 5 additions & 44 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,6 @@ http_archive(
url = "https://github.com/Mbed-TLS/mbedtls/releases/download/v2.28.8/mbedtls-2.28.8.tar.bz2",
)

# TODO: https://pwbug.dev/354747966 - Update the BCR version of Emboss.
git_repository(
name = "com_google_emboss",
# LINT.IfChange(emboss)
remote = "https://pigweed.googlesource.com/third_party/github/google/emboss",
tag = "v2024.0809.170004",
# LINT.ThenChange(/pw_package/py/pw_package/packages/emboss.py:emboss)
)

git_repository(
name = "mcuxpresso",
commit = "6f3fd257cdcf978a4d26e7d6e9eed9240037422b",
Expand Down
4 changes: 2 additions & 2 deletions pw_bluetooth_sapphire/host/gap/bredr_connection_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ void BrEdrConnectionManager::AttachInspect(inspect::Node& parent,

void BrEdrConnectionManager::WritePageTimeout(
pw::chrono::SystemClock::duration page_timeout, hci::ResultFunction<> cb) {
BT_ASSERT(page_timeout >= hci_spec::kMinPageTimeoutDuration);
BT_ASSERT(page_timeout <= hci_spec::kMaxPageTimeoutDuration);
PW_CHECK(page_timeout >= hci_spec::kMinPageTimeoutDuration);
PW_CHECK(page_timeout <= hci_spec::kMaxPageTimeoutDuration);

const int64_t raw_page_timeout =
page_timeout / hci_spec::kPerPageTimeoutUnit;
Expand Down
5 changes: 5 additions & 0 deletions pw_bluetooth_sapphire_mcuxpresso/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ cc_library(
"public",
],
deps = [
"@pigweed//pw_containers:vector",
"@pigweed//pw_containers:inline_queue",
"@pigweed//pw_thread:thread",
"@pigweed//pw_sync:interrupt_spin_lock",
"@pigweed//pw_sync:thread_notification",
"@pigweed//pw_bluetooth:pw_bluetooth",
"@pigweed//pw_bluetooth_sapphire/host:stack",
"//targets:mcuxpresso_sdk",
Expand Down
Loading

0 comments on commit 2fc5d06

Please sign in to comment.