Skip to content

Cellular: Remove friend definitions from cellular state machine #12251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions features/cellular/framework/device/CellularStateMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ class CellularDevice;
* Finite State Machine for attaching to cellular network. Used by CellularDevice.
*/
class CellularStateMachine {
private:
// friend of CellularDevice so that it's the only way to close/delete this class.
friend class CellularDevice;
friend class AT_CellularDevice;
public:
friend class UT_CellularStateMachine; // for unit tests

/** Constructor
*
* @param device reference to CellularDevice
Expand Down Expand Up @@ -128,8 +126,21 @@ class CellularStateMachine {
/** Reset the state machine to init state. After reset state machine can be used again to run to wanted state.
*/
void reset();
private:

/** Get retry timeout array
*
* @param timeout Pointer to timeout array
* @param array_len Max lenght of the array
*/
void get_retry_timeout_array(uint16_t *timeout, int &array_len) const;

/** Change all cellular state timeouts
*
* @param timeout Timeout value (milliseconds)
*/
void set_timeout(int timeout);

private:
bool power_on();
bool open_sim();
bool get_network_registration(CellularNetwork::RegistrationType type, CellularNetwork::RegistrationStatus &status, bool &is_registered);
Expand Down Expand Up @@ -188,8 +199,7 @@ class CellularStateMachine {
int _state_timeout_registration;
int _state_timeout_network;
int _state_timeout_connect; // timeout for PS attach, PDN connect and socket operations
// Change all cellular state timeouts to `timeout`
void set_timeout(int timeout);

cell_signal_quality_t _signal_quality;
};

Expand Down