Skip to content

Commit

Permalink
ArduinoJson deprecated fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cotestatnt committed Sep 26, 2024
1 parent 749a82e commit e7ba972
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/AsyncTelegram2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ bool AsyncTelegram2::getUpdates()
if (m_waitingReply == false)
{
char payload[BUFFER_SMALL];
snprintf(payload, BUFFER_SMALL, "{\"limit\":1,\"timeout\":0,\"offset\":%" INT32 "}", m_lastUpdateId);
snprintf(payload, BUFFER_SMALL, "{\"limit\":1,\"timeout\":0,\"offset\":%" INT32 "}", (int)m_lastUpdateId);
sendCommand("getUpdates", payload);
}
}
Expand Down Expand Up @@ -264,7 +264,8 @@ MessageType AsyncTelegram2::getNewMessage(TBMessage &message)
updateDoc.shrinkToFit();

m_rxbuffer = "";
if (!updateDoc.containsKey("result"))
// if (!updateDoc.containsKey("result")) // Deprecated
if (!updateDoc["result"].is<const char*>())
{
log_error("JSON data not expected");
serializeJsonPretty(updateDoc, Serial);
Expand Down

0 comments on commit e7ba972

Please sign in to comment.