File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -231,9 +231,19 @@ async fn submit_up(
231231 state. ble_sig . signal ( BleAction :: StartScan ) ;
232232 }
233233 2 => {
234+ if unsafe { !crate :: state:: AUTO_SETUP } {
235+ state_val. error_text = Some ( "AutoSetup Mode Disabled" . to_string ( ) ) ;
236+ return Ok ( true ) ;
237+ }
238+
234239 state_val. menu_scene = Some ( MenuScene :: Signing ) ;
235240 }
236241 3 => {
242+ if unsafe { !crate :: state:: AUTO_SETUP } {
243+ state_val. error_text = Some ( "AutoSetup Mode Disabled" . to_string ( ) ) ;
244+ return Ok ( true ) ;
245+ }
246+
237247 state_val. menu_scene = Some ( MenuScene :: Unsigning ) ;
238248 }
239249 4 => { } // Exit
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ pub static mut SIGN_KEY: u32 = 0;
1717pub static mut TRUST_SERVER : bool = false ;
1818pub static mut FKM_TOKEN : i32 = 0 ;
1919pub static mut SECURE_RFID : bool = false ;
20+ pub static mut AUTO_SETUP : bool = false ;
2021
2122pub static mut EPOCH_BASE : u64 = 0 ;
2223pub static mut SLEEP_STATE : bool = false ;
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ pub enum TimerPacketInner {
8686 default_locale : String ,
8787 fkm_token : i32 ,
8888 secure_rfid : bool ,
89+ auto_setup : bool ,
8990 } ,
9091 Logs {
9192 logs : Vec < String > ,
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ pub async fn ws_task(
4949
5050 loop {
5151 unsafe { crate :: state:: TRUST_SERVER = false } ;
52+ unsafe { crate :: state:: SECURE_RFID = false } ;
53+ unsafe { crate :: state:: AUTO_SETUP = false } ;
54+ unsafe { crate :: state:: FKM_TOKEN = 0 } ;
5255
5356 let ws_fut = ws_loop (
5457 & global_state,
@@ -223,7 +226,6 @@ async fn ws_loop(
223226 if random == recv_random {
224227 unsafe { crate :: state:: TRUST_SERVER = true } ;
225228 unsafe { crate :: state:: FKM_TOKEN = fkm_token } ;
226- unsafe { crate :: state:: SECURE_RFID = false } ;
227229 }
228230 }
229231
@@ -359,6 +361,7 @@ async fn ws_rw(
359361 default_locale,
360362 fkm_token,
361363 secure_rfid,
364+ auto_setup,
362365 } => {
363366 let mut state = global_state. state . lock ( ) . await ;
364367 state. device_added = Some ( added) ;
@@ -376,6 +379,7 @@ async fn ws_rw(
376379
377380 unsafe { crate :: state:: FKM_TOKEN = fkm_token } ;
378381 unsafe { crate :: state:: SECURE_RFID = secure_rfid } ;
382+ unsafe { crate :: state:: AUTO_SETUP = auto_setup } ;
379383 }
380384 TimerPacketInner :: ApiError ( e) => {
381385 // if should_reset_time reset time
You can’t perform that action at this time.
0 commit comments