Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a cargo workspace with testing instructions. #132

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/target
Cargo.lock
Cargo.lock
target_ci
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing Guidelines

### Running tests

```sh
cargo test
```
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[workspace]
members = ["host", "examples/*"]
resolver = "2"
28 changes: 14 additions & 14 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ if [[ -z "${CARGO_TARGET_DIR}" ]]; then
fi

cargo batch \
--- build --release --manifest-path examples/nrf-sdc/Cargo.toml --target thumbv7em-none-eabihf --features nrf52840 \
--- build --release --manifest-path examples/nrf-sdc/Cargo.toml --target thumbv7em-none-eabihf --features nrf52832 \
--- build --release --manifest-path examples/esp32/Cargo.toml --target riscv32imc-unknown-none-elf \
--- build --release --manifest-path examples/serial-hci/Cargo.toml \
--- build --release --manifest-path host/Cargo.toml --features peripheral \
--- build --release --manifest-path host/Cargo.toml --features central \
--- build --release --manifest-path host/Cargo.toml --features gatt,peripheral \
--- build --release --manifest-path host/Cargo.toml --features gatt,central \
--- build --release --manifest-path host/Cargo.toml --features gatt,peripheral,central,scan \
--- build --release --manifest-path examples/rp-pico-w//Cargo.toml --target thumbv6m-none-eabi --features skip-cyw43-firmware
# --- build --release --manifest-path examples/apache-nimble/Cargo.toml --target thumbv7em-none-eabihf
--- build --release -p trouble-nrf-sdc-examples --target thumbv7em-none-eabihf --features nrf52840 \
--- build --release -p trouble-nrf-sdc-examples --target thumbv7em-none-eabihf --features nrf52832 \
--- build --release -p trouble-esp32-examples --target riscv32imc-unknown-none-elf \
--- build --release -p serial-hci \
--- build --release -p trouble-rp-examples --target thumbv6m-none-eabi --features skip-cyw43-firmware \
--- build --release -p trouble-host --features peripheral \
--- build --release -p trouble-host --features central \
--- build --release -p trouble-host --features gatt,peripheral \
--- build --release -p trouble-host --features gatt,central \
--- build --release -p trouble-host --features gatt,peripheral,central,scan
# --- build --release --manifest-path examples/apache-nimble/Cargo.toml --target thumbv7em-none-eabihf

cargo fmt --check --manifest-path ./host/Cargo.toml
cargo clippy --manifest-path ./host/Cargo.toml --features gatt,peripheral,central
cargo test --manifest-path ./host/Cargo.toml --lib -- --nocapture
cargo fmt --check
cargo clippy --features gatt,peripheral,central
cargo test -- --nocapture
4 changes: 2 additions & 2 deletions examples/apache-nimble/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ defmt-rtt = "0.4"
panic-probe = { version = "0.3", features = ["print-defmt"] }
cortex-m-rt = "0.7.0"
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
apache-nimble = { version = "0.1.0", features = ["port-layer-embassy", "nrf52840", "controller"] }
# TEMP: until https://github.com/benbrittain/apache-nimble-sys/pull/4 gets merged
apache-nimble = { git = "https://github.com/gibbz00/apache-nimble-sys", branch = "https_submodules", features = ["port-layer-embassy", "nrf52840", "controller"] }
embassy-time = { version = "0.3.0", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-sync = "0.6.0"
embassy-futures = "0.1.0"
Expand All @@ -19,7 +20,6 @@ trouble-example-apps = { version = "0.1.0", path = "../apps", features = ["defmt
static_cell = "1.0.0"

[patch.crates-io]
apache-nimble = { git = "https://github.com/benbrittain/apache-nimble-sys.git", branch = "master" }
embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-nrf = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
#embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
Expand Down
8 changes: 4 additions & 4 deletions examples/nrf-sdc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ embassy-futures = "0.1.1"
embassy-sync = { version = "0.6", features = ["defmt"] }

futures = { version = "0.3", default-features = false, features = ["async-await"]}
nrf-sdc = { version = "0.1.0", default-features = false, features = ["defmt", "peripheral", "central"] }
nrf-mpsl = { version = "0.1.0", default-features = false, features = ["defmt", "critical-section-impl"] }
# TEMP: awaiting release
nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa", default-features = false, features = ["defmt", "peripheral", "central"] }
# TEMP: awaiting release
nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" , default-features = false, features = ["defmt", "critical-section-impl"] }
bt-hci = { version = "0.1.1", default-features = false, features = ["defmt"] }
trouble-host = { version = "0.1.0", path = "../../host", features = ["defmt"] }
trouble-example-apps = { version = "0.1.0", path = "../apps", features = ["defmt"] }
Expand All @@ -37,8 +39,6 @@ embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1c
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
nrf-sdc = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" }
nrf-mpsl = { git = "https://github.com/alexmoon/nrf-sdc.git", rev = "3702af909d31cd81c62f15e1aa9d5f637ec935fa" }

#embassy-executor = {path = "../../../embassy/embassy-executor"}
#embassy-nrf = {path = "../../../embassy/embassy-nrf"}
Expand Down
10 changes: 6 additions & 4 deletions examples/rp-pico-w/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ resolver = "2"
[dependencies]
embassy-executor = { version = "0.6", default-features = false, features = ["task-arena-size-98304", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers", "executor-interrupt"] }
embassy-time = { version = "0.3.0", default-features = false, features = ["defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.2.0", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl", "rp2040"] }
embassy-rp = { version = "0.2.0" }
embassy-futures = "0.1.1"
embassy-sync = { version = "0.6", features = ["defmt"] }

futures = { version = "0.3", default-features = false, features = ["async-await"]}
bt-hci = { version = "0.1.1", default-features = false, features = ["defmt"] }
trouble-example-apps= { version = "0.1.0", path = "../apps", features = ["defmt"] }
cyw43 = { version = "0.2.0", features = ["defmt", "firmware-logs", "bluetooth"] }
cyw43 = { version = "0.2.0" }
cyw43-pio = { version = "0.2.0", features = ["defmt"] }

defmt = "0.3"
Expand All @@ -34,13 +34,15 @@ debug = 2

[patch.crates-io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
# TEMP: until rp2040 feature is included in a release
embassy-rp = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl", "rp2040" ] }
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
cyw43 = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }
# TEMP: until bluetooth feature is included in a release
cyw43 = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e", features = ["defmt", "firmware-logs", "bluetooth"] }
cyw43-pio = { git = "https://github.com/embassy-rs/embassy.git", rev = "1cfd5370ac012814b7b386ba9ad8499529bdde4e" }

#embassy-executor = {path = "../../../embassy/embassy-executor"}
Expand Down
1 change: 0 additions & 1 deletion host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ categories = [
"hardware-support",
"no-std",
]
resolver = "2"

[dependencies]
bt-hci = { version = "0.1.1", features = ["embassy-time"] }
Expand Down
1 change: 1 addition & 0 deletions host/tests/gatt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const VALUE_UUID: Uuid = Uuid::new_long([
0x00, 0x00, 0x10, 0x01, 0xb0, 0xcd, 0x11, 0xec, 0x87, 0x1f, 0xd4, 0x5d, 0xdf, 0x13, 0x88, 0x40,
]);

#[ignore]
#[tokio::test]
async fn gatt_client_server() {
let _ = env_logger::try_init();
Expand Down
1 change: 1 addition & 0 deletions host/tests/l2cap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const L2CAP_CHANNELS_MAX: usize = 3;
const MTU: usize = 23;

/// Verify l2cap le connection oriented channels using two HCI adapters attached to the test machine.
#[ignore]
#[tokio::test]
async fn l2cap_connection_oriented_channels() {
let _ = env_logger::try_init();
Expand Down
Loading