diff --git a/.gitignore b/.gitignore index cd6ade7b..5d65d2fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/target -Cargo.lock \ No newline at end of file +Cargo.lock +target_ci diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..807bdb30 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing Guidelines + +### Running tests + +```sh +cargo test +``` diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..f7f599e9 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +members = ["host", "examples/*"] +resolver = "2" diff --git a/ci.sh b/ci.sh index 64fc9441..a71cf50e 100755 --- a/ci.sh +++ b/ci.sh @@ -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 diff --git a/examples/apache-nimble/Cargo.toml b/examples/apache-nimble/Cargo.toml index 18dc7b89..01a3ac71 100644 --- a/examples/apache-nimble/Cargo.toml +++ b/examples/apache-nimble/Cargo.toml @@ -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" @@ -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" } diff --git a/examples/nrf-sdc/Cargo.toml b/examples/nrf-sdc/Cargo.toml index c7ef45d9..080e4933 100644 --- a/examples/nrf-sdc/Cargo.toml +++ b/examples/nrf-sdc/Cargo.toml @@ -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"] } @@ -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"} diff --git a/examples/rp-pico-w/Cargo.toml b/examples/rp-pico-w/Cargo.toml index a84fa85e..22356bdd 100644 --- a/examples/rp-pico-w/Cargo.toml +++ b/examples/rp-pico-w/Cargo.toml @@ -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" @@ -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"} diff --git a/host/Cargo.toml b/host/Cargo.toml index 3dde956d..43290cc6 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -12,7 +12,6 @@ categories = [ "hardware-support", "no-std", ] -resolver = "2" [dependencies] bt-hci = { version = "0.1.1", features = ["embassy-time"] } diff --git a/host/tests/gatt.rs b/host/tests/gatt.rs index ac29c5d3..6dbbf775 100644 --- a/host/tests/gatt.rs +++ b/host/tests/gatt.rs @@ -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(); diff --git a/host/tests/l2cap.rs b/host/tests/l2cap.rs index 1fbe0920..f41f02f4 100644 --- a/host/tests/l2cap.rs +++ b/host/tests/l2cap.rs @@ -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();