File tree 2 files changed +19
-7
lines changed
2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -39,13 +39,8 @@ OTALogic::OTALogic(OTAStorage & ota_storage)
39
39
, _ota_state{OTAState::Init}
40
40
, _ota_error{OTAError::None}
41
41
{
42
- memset (_mqtt_ota_buf.buf , 0U , sizeof (_mqtt_ota_buf.buf ));
43
- _mqtt_ota_buf.num_bytes = 0 ;
44
-
45
- _ota_bin_data.hdr_len = 0 ;
46
- _ota_bin_data.hdr_crc32 = 0 ;
47
- _ota_bin_data.bytes_received = 0 ;
48
- _ota_bin_data.crc32 = crc_init ();
42
+ init_mqtt_ota_buffer ();
43
+ init_ota_binary_data ();
49
44
}
50
45
51
46
/* *****************************************************************************
@@ -233,3 +228,17 @@ OTAState OTALogic::handle_Reset()
233
228
#endif /* HOST */
234
229
return OTAState::Reset;
235
230
}
231
+
232
+ void OTALogic::init_mqtt_ota_buffer ()
233
+ {
234
+ memset (_mqtt_ota_buf.buf , 0U , sizeof (_mqtt_ota_buf.buf ));
235
+ _mqtt_ota_buf.num_bytes = 0 ;
236
+ }
237
+
238
+ void OTALogic::init_ota_binary_data ()
239
+ {
240
+ _ota_bin_data.hdr_len = 0 ;
241
+ _ota_bin_data.hdr_crc32 = 0 ;
242
+ _ota_bin_data.bytes_received = 0 ;
243
+ _ota_bin_data.crc32 = crc_init ();
244
+ }
Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ class OTALogic
106
106
OTAState handle_Verify ();
107
107
OTAState handle_Reset ();
108
108
109
+ void init_mqtt_ota_buffer ();
110
+ void init_ota_binary_data ();
111
+
109
112
};
110
113
111
114
#endif /* ARDUINO_OTA_LOGIC_H_ */
You can’t perform that action at this time.
0 commit comments