diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-09-11 22:06:26 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-09-16 21:17:11 +0200 |
| commit | be0d9775e3bcc3c1bd1448e357d7c6cd67b68991 (patch) | |
| tree | 5e8c444b233a86ade113b096ab1e2934b7bbc7bd /tests/perf-client/src | |
| parent | 7648d42b7f23a2caad29ed6e16123b088ccdc8b5 (diff) | |
net: refactor to simplify lifetimes/generics.
Diffstat (limited to 'tests/perf-client/src')
| -rw-r--r-- | tests/perf-client/src/lib.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/perf-client/src/lib.rs b/tests/perf-client/src/lib.rs index 54762379a..4bd9e5674 100644 --- a/tests/perf-client/src/lib.rs +++ b/tests/perf-client/src/lib.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | use defmt::{assert, *}; | 3 | use defmt::{assert, *}; |
| 4 | use embassy_futures::join::join; | 4 | use embassy_futures::join::join; |
| 5 | use embassy_net::driver::Driver; | ||
| 6 | use embassy_net::tcp::TcpSocket; | 5 | use embassy_net::tcp::TcpSocket; |
| 7 | use embassy_net::{Ipv4Address, Stack}; | 6 | use embassy_net::{Ipv4Address, Stack}; |
| 8 | use embassy_time::{with_timeout, Duration, Timer}; | 7 | use embassy_time::{with_timeout, Duration, Timer}; |
| @@ -13,7 +12,7 @@ pub struct Expected { | |||
| 13 | pub updown_kbps: usize, | 12 | pub updown_kbps: usize, |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 16 | pub async fn run<D: Driver>(stack: &Stack<D>, expected: Expected) { | 15 | pub async fn run(stack: Stack<'_>, expected: Expected) { |
| 17 | info!("Waiting for DHCP up..."); | 16 | info!("Waiting for DHCP up..."); |
| 18 | while stack.config_v4().is_none() { | 17 | while stack.config_v4().is_none() { |
| 19 | Timer::after_millis(100).await; | 18 | Timer::after_millis(100).await; |
| @@ -38,7 +37,7 @@ const DOWNLOAD_PORT: u16 = 4321; | |||
| 38 | const UPLOAD_PORT: u16 = 4322; | 37 | const UPLOAD_PORT: u16 = 4322; |
| 39 | const UPLOAD_DOWNLOAD_PORT: u16 = 4323; | 38 | const UPLOAD_DOWNLOAD_PORT: u16 = 4323; |
| 40 | 39 | ||
| 41 | async fn test_download<D: Driver>(stack: &Stack<D>) -> usize { | 40 | async fn test_download(stack: Stack<'_>) -> usize { |
| 42 | info!("Testing download..."); | 41 | info!("Testing download..."); |
| 43 | 42 | ||
| 44 | let mut rx_buffer = [0; RX_BUFFER_SIZE]; | 43 | let mut rx_buffer = [0; RX_BUFFER_SIZE]; |
| @@ -78,7 +77,7 @@ async fn test_download<D: Driver>(stack: &Stack<D>) -> usize { | |||
| 78 | kbps | 77 | kbps |
| 79 | } | 78 | } |
| 80 | 79 | ||
| 81 | async fn test_upload<D: Driver>(stack: &Stack<D>) -> usize { | 80 | async fn test_upload(stack: Stack<'_>) -> usize { |
| 82 | info!("Testing upload..."); | 81 | info!("Testing upload..."); |
| 83 | 82 | ||
| 84 | let mut rx_buffer = [0; RX_BUFFER_SIZE]; | 83 | let mut rx_buffer = [0; RX_BUFFER_SIZE]; |
| @@ -118,7 +117,7 @@ async fn test_upload<D: Driver>(stack: &Stack<D>) -> usize { | |||
| 118 | kbps | 117 | kbps |
| 119 | } | 118 | } |
| 120 | 119 | ||
| 121 | async fn test_upload_download<D: Driver>(stack: &Stack<D>) -> usize { | 120 | async fn test_upload_download(stack: Stack<'_>) -> usize { |
| 122 | info!("Testing upload+download..."); | 121 | info!("Testing upload+download..."); |
| 123 | 122 | ||
| 124 | let mut rx_buffer = [0; RX_BUFFER_SIZE]; | 123 | let mut rx_buffer = [0; RX_BUFFER_SIZE]; |
