Skip to content

Commit

Permalink
chore(tests/coap): Use re-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Jan 14, 2025
1 parent 71f16b2 commit 7790d01
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions tests/coap-blinky/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ workspace = true
ariel-os = { path = "../../src/ariel-os", features = [
"override-network-config",
"coap",
"udp",
] }
ariel-os-boards = { path = "../../src/ariel-os-boards" }
coap-handler-implementations = "0.5.0"

riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-examples", rev = "09fa2d45e92ca4e46da7f18af3db3d1bcec238d3", default-features = false, features = [
"gpio",
] }

# Just for the network config
heapless = { workspace = true }
11 changes: 11 additions & 0 deletions tests/coap-blinky/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ mod pins;
use ariel_os::gpio::Level;
use ariel_os::gpio::Output;

#[ariel_os::config(network)]
const NETWORK_CONFIG: ariel_os::reexports::embassy_net::Config = {
use ariel_os::reexports::embassy_net::{self, Ipv4Address};

embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
address: embassy_net::Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
dns_servers: heapless::Vec::new(),
gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
})
};

#[ariel_os::task(autostart, peripherals)]
async fn coap_run(peripherals: pins::LedPeripherals) {
use coap_handler_implementations::{new_dispatcher, HandlerBuilder, ReportingHandlerBuilder};
Expand Down
2 changes: 1 addition & 1 deletion tests/coap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ publish = false
workspace = true

[dependencies]
embassy-net = { workspace = true, features = ["udp"] }
embassy-sync = { workspace = true }
heapless = { workspace = true }
ariel-os = { path = "../../src/ariel-os", features = [
"override-network-config",
"coap",
"udp",
] }
ariel-os-boards = { path = "../../src/ariel-os-boards" }
embassy-futures = "0.1.1"
Expand Down
4 changes: 2 additions & 2 deletions tests/coap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#![feature(used_with_arg)]

#[ariel_os::config(network)]
const NETWORK_CONFIG: embassy_net::Config = {
use embassy_net::Ipv4Address;
const NETWORK_CONFIG: ariel_os::reexports::embassy_net::Config = {
use ariel_os::reexports::embassy_net::{self, Ipv4Address};

embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
address: embassy_net::Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
Expand Down

0 comments on commit 7790d01

Please sign in to comment.