11use core:: sync:: atomic:: Ordering ;
22
33use private:: { AtomicWifiAccessPointState , AtomicWifiStationState } ;
4- pub use private:: { WifiAccessPointState , WifiStationState } ;
4+ pub ( crate ) use private:: { WifiAccessPointState , WifiStationState } ;
55
66use super :: WifiEvent ;
77
@@ -14,12 +14,20 @@ mod private {
1414 #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
1515 #[ non_exhaustive]
1616 pub enum WifiStationState {
17+ /// Start initiated.
18+ Starting ,
1719 /// Station started.
1820 Started ,
21+ /// Connect initiated.
22+ Connecting ,
1923 /// Station connected.
2024 Connected ,
25+ /// Disconnect initiated.
26+ Disconnecting ,
2127 /// Station disconnected.
2228 Disconnected ,
29+ /// Stop initiated.
30+ Stopping ,
2331 /// Station stopped
2432 Stopped ,
2533 /// Invalid state.
@@ -32,8 +40,12 @@ mod private {
3240 #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
3341 #[ non_exhaustive]
3442 pub enum WifiAccessPointState {
43+ /// Start initiated.
44+ Starting ,
3545 /// Access point started.
3646 Started ,
47+ /// Stop initiated.
48+ Stopping ,
3749 /// Access point stopped.
3850 Stopped ,
3951 /// Invalid state.
@@ -69,12 +81,12 @@ pub(crate) static ACCESS_POINT_STATE: AtomicWifiAccessPointState =
6981 AtomicWifiAccessPointState :: new ( WifiAccessPointState :: Invalid ) ;
7082
7183/// Get the current state of the access point.
72- pub fn access_point_state ( ) -> WifiAccessPointState {
84+ pub ( crate ) fn access_point_state ( ) -> WifiAccessPointState {
7385 ACCESS_POINT_STATE . load ( Ordering :: Relaxed )
7486}
7587
7688/// Get the current state of the Station.
77- pub fn station_state ( ) -> WifiStationState {
89+ pub ( crate ) fn station_state ( ) -> WifiStationState {
7890 STATION_STATE . load ( Ordering :: Relaxed )
7991}
8092
@@ -99,10 +111,10 @@ pub(crate) fn update_state(event: WifiEvent, handled: bool) {
99111 }
100112}
101113
102- pub ( crate ) fn reset_access_point_state ( ) {
103- ACCESS_POINT_STATE . store ( WifiAccessPointState :: Invalid , Ordering :: Relaxed )
114+ pub ( crate ) fn set_access_point_state ( state : WifiAccessPointState ) {
115+ ACCESS_POINT_STATE . store ( state , Ordering :: Relaxed )
104116}
105117
106- pub ( crate ) fn reset_station_state ( ) {
107- STATION_STATE . store ( WifiStationState :: Invalid , Ordering :: Relaxed )
118+ pub ( crate ) fn set_station_state ( state : WifiStationState ) {
119+ STATION_STATE . store ( state , Ordering :: Relaxed )
108120}
0 commit comments