aboutsummaryrefslogtreecommitdiff
path: root/examples/rp/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-01-19 13:57:21 +0000
committerGitHub <[email protected]>2023-01-19 13:57:21 +0000
commit539a8107e2f09338294727f47827dec42104505f (patch)
tree8549000f6edc66d860de44b7400d62a27c674d4f /examples/rp/src
parent65ab714fae6315a032e7440f44429ced36d2506e (diff)
parent78c2c1709b8c111468fd7dd2ec1f3792d2fcea67 (diff)
Merge #1161
1161: WIP: Smoltcp socket config r=Dirbaio a=Czocher This PR updates the smoltcp version to the newest master one as well as implements the feature specified in #1154 - to allow the dhcpv4 socket to be configured. Currently it should be considered a WIP PR - requires testing. `@Dirbaio` can you have a look and check if this is compatible with what we discussed on the matrix channel? Co-authored-by: Paweł Jan Czochański <[email protected]> Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/rp/src')
-rw-r--r--examples/rp/src/bin/usb_ethernet.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs
index d0aec874a..104b25d39 100644
--- a/examples/rp/src/bin/usb_ethernet.rs
+++ b/examples/rp/src/bin/usb_ethernet.rs
@@ -92,8 +92,8 @@ async fn main(spawner: Spawner) {
92 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(singleton!(NetState::new()), our_mac_addr); 92 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(singleton!(NetState::new()), our_mac_addr);
93 unwrap!(spawner.spawn(usb_ncm_task(runner))); 93 unwrap!(spawner.spawn(usb_ncm_task(runner)));
94 94
95 let config = embassy_net::ConfigStrategy::Dhcp; 95 let config = embassy_net::Config::Dhcp(Default::default());
96 //let config = embassy_net::ConfigStrategy::Static(embassy_net::Config { 96 //let config = embassy_net::Config::Static(embassy_net::StaticConfig {
97 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 97 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
98 // dns_servers: Vec::new(), 98 // dns_servers: Vec::new(),
99 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 99 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
@@ -103,12 +103,7 @@ async fn main(spawner: Spawner) {
103 let seed = 1234; // guaranteed random, chosen by a fair dice roll 103 let seed = 1234; // guaranteed random, chosen by a fair dice roll
104 104
105 // Init network stack 105 // Init network stack
106 let stack = &*singleton!(Stack::new( 106 let stack = &*singleton!(Stack::new(device, config, singleton!(StackResources::<2>::new()), seed));
107 device,
108 config,
109 singleton!(StackResources::<1, 2, 8>::new()),
110 seed
111 ));
112 107
113 unwrap!(spawner.spawn(net_task(stack))); 108 unwrap!(spawner.spawn(net_task(stack)));
114 109