Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/AIoTC_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@
#define AIOT_CONFIG_RP2040_OTA_HTTP_HEADER_RECEIVE_TIMEOUT_ms (10*1000UL)
#define AIOT_CONFIG_RP2040_OTA_HTTP_DATA_RECEIVE_TIMEOUT_ms (4*60*1000UL)

#define AIOT_CONFIG_LIB_VERSION "1.15.1"
#define AIOT_CONFIG_LIB_VERSION "2.0.0"

#endif /* ARDUINO_AIOTC_CONFIG_H_ */
7 changes: 7 additions & 0 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
}
break;

case CommandId::TimezoneCommandDownId:
{
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] timezone update received", __FUNCTION__, millis());
_thing.handleMessage((Message*)&command);
}
break;

case CommandId::LastValuesUpdateCmdId:
{
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] last values received", __FUNCTION__, millis());
Expand Down
8 changes: 8 additions & 0 deletions src/ArduinoIoTCloudThing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ void ArduinoCloudThing::update() {
nextState = State::Connected;
}
break;

/* We have received a timezone update */
case TimezoneCommandDownId:
{
TimezoneCommandDown * cmd = (TimezoneCommandDown *)_command;
TimeService.setTimeZoneData(cmd->params.offset, cmd->params.until);
}
break;

/* We have received a reset command */
case ResetCmdId:
Expand Down
7 changes: 7 additions & 0 deletions src/cbor/MessageDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ CBORMessageDecoder::ArrayParserState CBORMessageDecoder::decodeThingUpdateCmd(Cb
return ArrayParserState::Error;
}

size_t thingIdLen = strlen(thingCommand->params.thing_id);

// thing_id length normally is 36, or 0 in case of device not attached to any thing
if (!((thingIdLen == sizeof(thingCommand->params.thing_id) -1) || (thingIdLen == 0))) {
return ArrayParserState::Error;
}

return ArrayParserState::LeaveArray;
}

Expand Down