Skip to content

Commit 9686110

Browse files
authored
Merge pull request #12251 from kivaisan/remove_friends_from_statemachine
Cellular: Remove friend definitions from cellular state machine
2 parents 32675cc + 52b00a2 commit 9686110

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

features/cellular/framework/device/CellularStateMachine.h

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ class CellularDevice;
3131
* Finite State Machine for attaching to cellular network. Used by CellularDevice.
3232
*/
3333
class CellularStateMachine {
34-
private:
35-
// friend of CellularDevice so that it's the only way to close/delete this class.
36-
friend class CellularDevice;
37-
friend class AT_CellularDevice;
34+
public:
3835
friend class UT_CellularStateMachine; // for unit tests
36+
3937
/** Constructor
4038
*
4139
* @param device reference to CellularDevice
@@ -128,8 +126,21 @@ class CellularStateMachine {
128126
/** Reset the state machine to init state. After reset state machine can be used again to run to wanted state.
129127
*/
130128
void reset();
131-
private:
129+
130+
/** Get retry timeout array
131+
*
132+
* @param timeout Pointer to timeout array
133+
* @param array_len Max lenght of the array
134+
*/
132135
void get_retry_timeout_array(uint16_t *timeout, int &array_len) const;
136+
137+
/** Change all cellular state timeouts
138+
*
139+
* @param timeout Timeout value (milliseconds)
140+
*/
141+
void set_timeout(int timeout);
142+
143+
private:
133144
bool power_on();
134145
bool open_sim();
135146
bool get_network_registration(CellularNetwork::RegistrationType type, CellularNetwork::RegistrationStatus &status, bool &is_registered);
@@ -188,8 +199,7 @@ class CellularStateMachine {
188199
int _state_timeout_registration;
189200
int _state_timeout_network;
190201
int _state_timeout_connect; // timeout for PS attach, PDN connect and socket operations
191-
// Change all cellular state timeouts to `timeout`
192-
void set_timeout(int timeout);
202+
193203
cell_signal_quality_t _signal_quality;
194204
};
195205

0 commit comments

Comments
 (0)