Skip to content

Commit 3f3195f

Browse files
OTAInterface removing params
1 parent 250501f commit 3f3195f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/ota/interface/OTAInterface.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ OTACloudProcessInterface::State OTACloudProcessInterface::otaBegin() {
112112
calculateSHA256(sha256_calc);
113113

114114
sha256_calc.finalize(sha256);
115-
memcpy(msg.params.sha, sha256, SHA256::HASH_SIZE);
115+
memcpy(msg.sha, sha256, SHA256::HASH_SIZE);
116116

117117
DEBUG_VERBOSE("calculated SHA256: "
118118
"0x%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X"
@@ -152,8 +152,8 @@ OTACloudProcessInterface::State OTACloudProcessInterface::idle(Message* msg) {
152152
struct OtaUpdateCmdDown* ota_msg = (struct OtaUpdateCmdDown*)msg;
153153

154154
context = new OtaContext(
155-
ota_msg->params.id, ota_msg->params.url,
156-
ota_msg->params.initialSha256, ota_msg->params.finalSha256
155+
ota_msg->id, ota_msg->url,
156+
ota_msg->initialSha256, ota_msg->finalSha256
157157
);
158158

159159
// TODO verify that initialSha256 is the sha256 on board
@@ -201,18 +201,18 @@ void OTACloudProcessInterface::reportStatus(int32_t state_data) {
201201
OtaProgressCmdUpId,
202202
};
203203

204-
memcpy(msg.params.id, context->id, ID_SIZE);
205-
msg.params.state = state>=0 ? state : State::Fail;
204+
memcpy(msg.id, context->id, ID_SIZE);
205+
msg.state = state>=0 ? state : State::Fail;
206206

207207
if(new_timestamp == report_last_timestamp) {
208-
msg.params.time = new_timestamp*1e6 + ++report_counter;
208+
msg.time = new_timestamp*1e6 + ++report_counter;
209209
} else {
210-
msg.params.time = new_timestamp*1e6;
210+
msg.time = new_timestamp*1e6;
211211
report_counter = 0;
212212
report_last_timestamp = new_timestamp;
213213
}
214214

215-
msg.params.state_data = state_data;
215+
msg.state_data = state_data;
216216

217217
deliver((Message*)&msg);
218218
}

0 commit comments

Comments
 (0)