File tree 1 file changed +17
-15
lines changed
1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,23 @@ void ArduinoCloudThing::begin() {
59
59
}
60
60
61
61
void ArduinoCloudThing::update () {
62
+ handleMessage (nullptr );
63
+ }
64
+
65
+ int ArduinoCloudThing::connected () {
66
+ return _state > State::Disconnect ? 1 : 0 ;
67
+ }
68
+
69
+ void ArduinoCloudThing::handleMessage (Message* m) {
70
+ _command = UnknownCmdId;
71
+ if (m != nullptr ) {
72
+ _command = m->id ;
73
+ if (_command == TimezoneCommandDownId) {
74
+ _utcOffset = reinterpret_cast <TimezoneCommandDown*>(m)->params .offset ;
75
+ _utcOffsetExpireTime = reinterpret_cast <TimezoneCommandDown*>(m)->params .until ;
76
+ }
77
+ }
78
+
62
79
/* Run through the state machine. */
63
80
State nextState = _state;
64
81
switch (_state) {
@@ -95,21 +112,6 @@ void ArduinoCloudThing::update() {
95
112
_state = nextState;
96
113
}
97
114
98
- int ArduinoCloudThing::connected () {
99
- return _state > State::Disconnect ? 1 : 0 ;
100
- }
101
-
102
- void ArduinoCloudThing::handleMessage (Message* m) {
103
- _command = UnknownCmdId;
104
- if (m != nullptr ) {
105
- _command = m->id ;
106
- if (_command == TimezoneCommandDownId) {
107
- _utcOffset = reinterpret_cast <TimezoneCommandDown*>(m)->params .offset ;
108
- _utcOffsetExpireTime = reinterpret_cast <TimezoneCommandDown*>(m)->params .until ;
109
- }
110
- }
111
- }
112
-
113
115
ArduinoCloudThing::State ArduinoCloudThing::handleInit () {
114
116
_syncAttempt.begin (AIOT_CONFIG_TIMEOUT_FOR_LASTVALUES_SYNC_ms);
115
117
return State::RequestLastValues;
You can’t perform that action at this time.
0 commit comments