mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-31 00:32:52 +00:00
sm: extract sm_run_non_connection_logic
This commit is contained in:
parent
b919f26479
commit
de42cac54a
31
src/ble/sm.c
31
src/ble/sm.c
@ -2702,6 +2702,21 @@ static void sm_run_state_sc_send_public_key_command(sm_connection_t *connection)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool sm_run_non_connection_logic(void){
|
||||||
|
bool done;;
|
||||||
|
|
||||||
|
done = sm_run_dpkg();
|
||||||
|
if (done) return true;
|
||||||
|
|
||||||
|
done = sm_run_rau();
|
||||||
|
if (done) return true;
|
||||||
|
|
||||||
|
done = sm_run_csrk();
|
||||||
|
if (done) return true;
|
||||||
|
|
||||||
|
done = sm_run_oob();
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
static void sm_run(void){
|
static void sm_run(void){
|
||||||
|
|
||||||
@ -2714,22 +2729,8 @@ static void sm_run(void){
|
|||||||
// pause until IR/ER are ready
|
// pause until IR/ER are ready
|
||||||
if (sm_persistent_keys_random_active) return;
|
if (sm_persistent_keys_random_active) return;
|
||||||
|
|
||||||
bool done;
|
|
||||||
|
|
||||||
//
|
|
||||||
// non-connection related behaviour
|
// non-connection related behaviour
|
||||||
//
|
bool done = sm_run_non_connection_logic();
|
||||||
|
|
||||||
done = sm_run_dpkg();
|
|
||||||
if (done) return;
|
|
||||||
|
|
||||||
done = sm_run_rau();
|
|
||||||
if (done) return;
|
|
||||||
|
|
||||||
done = sm_run_csrk();
|
|
||||||
if (done) return;
|
|
||||||
|
|
||||||
done = sm_run_oob();
|
|
||||||
if (done) return;
|
if (done) return;
|
||||||
|
|
||||||
// assert that we can send at least commands - cmd might have been sent by crypto engine
|
// assert that we can send at least commands - cmd might have been sent by crypto engine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user