diff options
| author | Ulf Lilleengen <[email protected]> | 2024-09-05 10:31:51 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2024-09-05 10:31:51 +0200 |
| commit | 5d0ed246400b1e7973c1fe870dba977ab7186a21 (patch) | |
| tree | 83226455df6070824fe796bcf865963698dd5e4b | |
| parent | 836e8add1bcb09c476a3aa3d7a416a15b8c21e6a (diff) | |
Move configure out of run
| -rw-r--r-- | embassy-net-nrf91/src/context.rs | 3 | ||||
| -rw-r--r-- | examples/nrf9160/src/bin/modem_tcp_client.rs | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/embassy-net-nrf91/src/context.rs b/embassy-net-nrf91/src/context.rs index 6b841aa16..3671fdd68 100644 --- a/embassy-net-nrf91/src/context.rs +++ b/embassy-net-nrf91/src/context.rs | |||
| @@ -284,8 +284,7 @@ impl<'a> Control<'a> { | |||
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | /// Run a control loop for this context, ensuring that reaattach is handled. | 286 | /// Run a control loop for this context, ensuring that reaattach is handled. |
| 287 | pub async fn run<F: Fn(&Status)>(&self, config: &Config<'_>, reattach: F) -> Result<(), Error> { | 287 | pub async fn run<F: Fn(&Status)>(&self, reattach: F) -> Result<(), Error> { |
| 288 | self.configure(config).await?; | ||
| 289 | let status = self.wait_attached().await?; | 288 | let status = self.wait_attached().await?; |
| 290 | let mut fd = self.control.open_raw_socket().await; | 289 | let mut fd = self.control.open_raw_socket().await; |
| 291 | reattach(&status); | 290 | reattach(&status); |
diff --git a/examples/nrf9160/src/bin/modem_tcp_client.rs b/examples/nrf9160/src/bin/modem_tcp_client.rs index b7d56802d..7d78eba0a 100644 --- a/examples/nrf9160/src/bin/modem_tcp_client.rs +++ b/examples/nrf9160/src/bin/modem_tcp_client.rs | |||
| @@ -56,9 +56,10 @@ async fn control_task( | |||
| 56 | config: context::Config<'static>, | 56 | config: context::Config<'static>, |
| 57 | stack: &'static Stack<embassy_net_nrf91::NetDriver<'static>>, | 57 | stack: &'static Stack<embassy_net_nrf91::NetDriver<'static>>, |
| 58 | ) { | 58 | ) { |
| 59 | unwrap!(control.configure(&config).await); | ||
| 59 | unwrap!( | 60 | unwrap!( |
| 60 | control | 61 | control |
| 61 | .run(&config, |status| { | 62 | .run(|status| { |
| 62 | stack.set_config_v4(status_to_config(status)); | 63 | stack.set_config_v4(status_to_config(status)); |
| 63 | }) | 64 | }) |
| 64 | .await | 65 | .await |
