aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-esp-hosted/src/ioctl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-net-esp-hosted/src/ioctl.rs')
-rw-r--r--embassy-net-esp-hosted/src/ioctl.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/embassy-net-esp-hosted/src/ioctl.rs b/embassy-net-esp-hosted/src/ioctl.rs
index a516f80c7..7f462d528 100644
--- a/embassy-net-esp-hosted/src/ioctl.rs
+++ b/embassy-net-esp-hosted/src/ioctl.rs
@@ -24,6 +24,7 @@ pub struct Shared(RefCell<SharedInner>);
24struct SharedInner { 24struct SharedInner {
25 ioctl: IoctlState, 25 ioctl: IoctlState,
26 is_init: bool, 26 is_init: bool,
27 is_ota: bool,
27 control_waker: WakerRegistration, 28 control_waker: WakerRegistration,
28 runner_waker: WakerRegistration, 29 runner_waker: WakerRegistration,
29} 30}
@@ -33,6 +34,7 @@ impl Shared {
33 Self(RefCell::new(SharedInner { 34 Self(RefCell::new(SharedInner {
34 ioctl: IoctlState::Done { resp_len: 0 }, 35 ioctl: IoctlState::Done { resp_len: 0 },
35 is_init: false, 36 is_init: false,
37 is_ota: false,
36 control_waker: WakerRegistration::new(), 38 control_waker: WakerRegistration::new(),
37 runner_waker: WakerRegistration::new(), 39 runner_waker: WakerRegistration::new(),
38 })) 40 }))
@@ -99,11 +101,26 @@ impl Shared {
99 } 101 }
100 } 102 }
101 103
104 // ota
105 pub fn ota_done(&self) {
106 let mut this = self.0.borrow_mut();
107 this.is_ota = true;
108 this.is_init = false;
109 this.runner_waker.wake();
110 }
111
112 // check if ota is in progress
113 pub fn is_ota(&self) -> bool {
114 let this = self.0.borrow();
115 this.is_ota
116 }
117
102 // // // // // // // // // // // // // // // // // // // // 118 // // // // // // // // // // // // // // // // // // // //
103 119
104 pub fn init_done(&self) { 120 pub fn init_done(&self) {
105 let mut this = self.0.borrow_mut(); 121 let mut this = self.0.borrow_mut();
106 this.is_init = true; 122 this.is_init = true;
123 this.is_ota = false;
107 this.control_waker.wake(); 124 this.control_waker.wake();
108 } 125 }
109 126