aboutsummaryrefslogtreecommitdiff
path: root/examples/std/src/bin
diff options
context:
space:
mode:
authorTyler <[email protected]>2023-08-24 17:38:04 -0600
committerGitHub <[email protected]>2023-08-24 17:38:04 -0600
commitf033089625b4883f9b8811f5c291292529f66767 (patch)
tree6ecb235b98bb67c9b064fca2b47e035fbeeb234e /examples/std/src/bin
parent6d8a5c6c20953c998df6ddd26906abe520df946d (diff)
parent2a6b743b9e8dbeef6b02320b2485f3f1efe4a337 (diff)
Merge pull request #3 from embassy-rs/main
Update to embassy head
Diffstat (limited to 'examples/std/src/bin')
-rw-r--r--examples/std/src/bin/net.rs7
-rw-r--r--examples/std/src/bin/net_dns.rs5
-rw-r--r--examples/std/src/bin/net_udp.rs5
-rw-r--r--examples/std/src/bin/serial.rs4
-rw-r--r--examples/std/src/bin/tcp_accept.rs7
5 files changed, 8 insertions, 20 deletions
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs
index 3aadb029d..8d8345057 100644
--- a/examples/std/src/bin/net.rs
+++ b/examples/std/src/bin/net.rs
@@ -6,17 +6,14 @@ use clap::Parser;
6use embassy_executor::{Executor, Spawner}; 6use embassy_executor::{Executor, Spawner};
7use embassy_net::tcp::TcpSocket; 7use embassy_net::tcp::TcpSocket;
8use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; 8use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources};
9use embassy_net_tuntap::TunTapDevice;
9use embassy_time::Duration; 10use embassy_time::Duration;
10use embedded_io::asynch::Write; 11use embedded_io_async::Write;
11use heapless::Vec; 12use heapless::Vec;
12use log::*; 13use log::*;
13use rand_core::{OsRng, RngCore}; 14use rand_core::{OsRng, RngCore};
14use static_cell::{make_static, StaticCell}; 15use static_cell::{make_static, StaticCell};
15 16
16#[path = "../tuntap.rs"]
17mod tuntap;
18
19use crate::tuntap::TunTapDevice;
20#[derive(Parser)] 17#[derive(Parser)]
21#[clap(version = "1.0")] 18#[clap(version = "1.0")]
22struct Opts { 19struct Opts {
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs
index 65b5a2cd9..6c19874d5 100644
--- a/examples/std/src/bin/net_dns.rs
+++ b/examples/std/src/bin/net_dns.rs
@@ -6,15 +6,12 @@ use clap::Parser;
6use embassy_executor::{Executor, Spawner}; 6use embassy_executor::{Executor, Spawner};
7use embassy_net::dns::DnsQueryType; 7use embassy_net::dns::DnsQueryType;
8use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; 8use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources};
9use embassy_net_tuntap::TunTapDevice;
9use heapless::Vec; 10use heapless::Vec;
10use log::*; 11use log::*;
11use rand_core::{OsRng, RngCore}; 12use rand_core::{OsRng, RngCore};
12use static_cell::{make_static, StaticCell}; 13use static_cell::{make_static, StaticCell};
13 14
14#[path = "../tuntap.rs"]
15mod tuntap;
16
17use crate::tuntap::TunTapDevice;
18#[derive(Parser)] 15#[derive(Parser)]
19#[clap(version = "1.0")] 16#[clap(version = "1.0")]
20struct Opts { 17struct Opts {
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs
index 3fc46156c..98dcc9925 100644
--- a/examples/std/src/bin/net_udp.rs
+++ b/examples/std/src/bin/net_udp.rs
@@ -4,15 +4,12 @@ use clap::Parser;
4use embassy_executor::{Executor, Spawner}; 4use embassy_executor::{Executor, Spawner};
5use embassy_net::udp::{PacketMetadata, UdpSocket}; 5use embassy_net::udp::{PacketMetadata, UdpSocket};
6use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; 6use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources};
7use embassy_net_tuntap::TunTapDevice;
7use heapless::Vec; 8use heapless::Vec;
8use log::*; 9use log::*;
9use rand_core::{OsRng, RngCore}; 10use rand_core::{OsRng, RngCore};
10use static_cell::{make_static, StaticCell}; 11use static_cell::{make_static, StaticCell};
11 12
12#[path = "../tuntap.rs"]
13mod tuntap;
14
15use crate::tuntap::TunTapDevice;
16#[derive(Parser)] 13#[derive(Parser)]
17#[clap(version = "1.0")] 14#[clap(version = "1.0")]
18struct Opts { 15struct Opts {
diff --git a/examples/std/src/bin/serial.rs b/examples/std/src/bin/serial.rs
index 85ee54f70..0b289c74d 100644
--- a/examples/std/src/bin/serial.rs
+++ b/examples/std/src/bin/serial.rs
@@ -5,7 +5,7 @@ mod serial_port;
5 5
6use async_io::Async; 6use async_io::Async;
7use embassy_executor::Executor; 7use embassy_executor::Executor;
8use embedded_io::asynch::Read; 8use embedded_io_async::Read;
9use log::*; 9use log::*;
10use nix::sys::termios; 10use nix::sys::termios;
11use static_cell::StaticCell; 11use static_cell::StaticCell;
@@ -29,7 +29,7 @@ async fn run() {
29 // 29 //
30 // This is not really needed, you could write the code below using futures::io directly. 30 // This is not really needed, you could write the code below using futures::io directly.
31 // It's useful if you want to have portable code across embedded and std. 31 // It's useful if you want to have portable code across embedded and std.
32 let mut port = embedded_io::adapters::FromFutures::new(port); 32 let mut port = embedded_io_adapters::futures_03::FromFutures::new(port);
33 33
34 info!("Serial opened!"); 34 info!("Serial opened!");
35 35
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs
index df09986ac..199e4c9ec 100644
--- a/examples/std/src/bin/tcp_accept.rs
+++ b/examples/std/src/bin/tcp_accept.rs
@@ -7,17 +7,14 @@ use clap::Parser;
7use embassy_executor::{Executor, Spawner}; 7use embassy_executor::{Executor, Spawner};
8use embassy_net::tcp::TcpSocket; 8use embassy_net::tcp::TcpSocket;
9use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; 9use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources};
10use embassy_net_tuntap::TunTapDevice;
10use embassy_time::{Duration, Timer}; 11use embassy_time::{Duration, Timer};
11use embedded_io::asynch::Write as _; 12use embedded_io_async::Write as _;
12use heapless::Vec; 13use heapless::Vec;
13use log::*; 14use log::*;
14use rand_core::{OsRng, RngCore}; 15use rand_core::{OsRng, RngCore};
15use static_cell::{make_static, StaticCell}; 16use static_cell::{make_static, StaticCell};
16 17
17#[path = "../tuntap.rs"]
18mod tuntap;
19
20use crate::tuntap::TunTapDevice;
21#[derive(Parser)] 18#[derive(Parser)]
22#[clap(version = "1.0")] 19#[clap(version = "1.0")]
23struct Opts { 20struct Opts {