Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/SIM7600MQTTClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ Status MQTTClient::setLastWillMessage(const char* topic, const char* message, co

SIM7600_LOGD(tag, "MQTTClient %u: Setting Will message", _client_id);

Status status =
status =
_modem->sendATCmd("AT+CMQTTWILLMSG=%u,%u,%u", _client_id, msg_len, static_cast<uint8_t>(qos));
if (status != Status::Success) return status;

// Send data after '>' prompt
size_t bytes_sent = 0;
bytes_sent = 0;
status =
_modem->_waitPromptAndSendData(reinterpret_cast<const uint8_t*>(message), msg_len, bytes_sent);
if (status != Status::Success) return status;
Expand Down
11 changes: 8 additions & 3 deletions src/SIM7600Modem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,20 +869,25 @@ Status Modem::getNetworkTime(NTPTimeData& time_data) {
return Status::InvalidResponse;
}

// Temporary 2 digit year
uint8_t year;

// Parse time
status = parseLine(time_buffer,
7,
"%2hhu/%2hhu/%2hhu,%2hhu:%2hhu:%2hhu%2hhd",
&time_data.year, // yy (last 2 digits)
&year, // yy (last 2 digits)
&time_data.month, // MM
&time_data.day, // dd
&time_data.hour, // hh
&time_data.minute, // mm
&time_data.second, // ss
&time_data.time_zone); // ±zz (quarters)

time_data.year += 2000; // Convert to full year
time_data.time_zone /= 4; // Convert to hours
if (status != Status::Success) return status;

time_data.year = 2000 + year; // Convert to full year
time_data.time_zone /= 4; // Convert to hours

return waitForResponse(AT_OK);
}
Expand Down