-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Implement a get_state_listener() function
The state_listener_ variable can store several different states, it would be interesting to have a function to get the current corresponding state on the Device.
enum THINGER_STATE{
NETWORK_CONNECTING,
NETWORK_CONNECTED,
NETWORK_CONNECT_ERROR,
SOCKET_CONNECTING,
SOCKET_CONNECTED,
SOCKET_CONNECTION_ERROR,
SOCKET_DISCONNECTED,
SOCKET_TIMEOUT,
SOCKET_ERROR,
THINGER_AUTHENTICATING,
THINGER_AUTH_FAILED,
THINGER_STOP_REQUEST
};
This function can help to implement some functionality like:
If state_listener is equal to NETWORK_CONNECT_ERROR, then blink YELLOW LED;
If state_listener is equal to SOCKET_ERROR or THINGER_AUTH_FAILED, then blink RED LED;
If state_listener is equal to THINGER_AUTHENTICATEDor THINGER_AUTH_FAILED, then blink GREEN LED;
Metadata
Metadata
Assignees
Labels
No labels