Skip to content

Commit d344c46

Browse files
committed
Manually wrap and add hidden properties into the _device_property_container
1 parent cd98ce2 commit d344c46

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/ArduinoIoTCloudTCP.cpp

+17-9
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,26 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
250250
_deviceTopicOut = getTopic_deviceout();
251251
_deviceTopicIn = getTopic_devicein();
252252

253-
addPropertyReal(_lib_version, _device_property_container, "LIB_VERSION", Permission::Read);
253+
Property* p;
254+
p = new CloudWrapperString(_lib_version);
255+
addPropertyToContainer(_device_property_container, *p, "LIB_VERSION", Permission::Read, -1);
254256
#if OTA_ENABLED
255-
addPropertyReal(_ota_cap, _device_property_container, "OTA_CAP", Permission::Read);
256-
addPropertyReal(_ota_error, _device_property_container, "OTA_ERROR", Permission::Read);
257-
addPropertyReal(_ota_img_sha256, _device_property_container, "OTA_SHA256", Permission::Read);
258-
addPropertyReal(_ota_url, _device_property_container, "OTA_URL", Permission::ReadWrite);
259-
addPropertyReal(_ota_req, _device_property_container, "OTA_REQ", Permission::ReadWrite);
257+
p = new CloudWrapperBool(_ota_cap);
258+
addPropertyToContainer(_device_property_container, *p, "OTA_CAP", Permission::Read, -1);
259+
p = new CloudWrapperInt(_ota_error);
260+
addPropertyToContainer(_device_property_container, *p, "OTA_ERROR", Permission::Read, -1);
261+
p = new CloudWrapperString(_ota_img_sha256);
262+
addPropertyToContainer(_device_property_container, *p, "OTA_SHA256", Permission::Read, -1);
263+
p = new CloudWrapperString(_ota_url);
264+
addPropertyToContainer(_device_property_container, *p, "OTA_URL", Permission::ReadWrite, -1);
265+
p = new CloudWrapperBool(_ota_req);
266+
addPropertyToContainer(_device_property_container, *p, "OTA_REQ", Permission::ReadWrite, -1);
260267
#endif /* OTA_ENABLED */
268+
p = new CloudWrapperString(_thing_id);
269+
addPropertyToContainer(_device_property_container, *p, "thing_id", Permission::ReadWrite, -1).onUpdate(setThingIdOutdated);
261270

262-
addPropertyReal(_tz_offset, _thing_property_container, "tz_offset", Permission::ReadWrite).onSync(CLOUD_WINS).onUpdate(updateTimezoneInfo);
263-
addPropertyReal(_tz_dst_until, _thing_property_container, "tz_dst_until", Permission::ReadWrite).onSync(CLOUD_WINS).onUpdate(updateTimezoneInfo);
264-
addPropertyReal(_thing_id, _device_property_container, "thing_id", Permission::ReadWrite).onUpdate(setThingIdOutdated);
271+
addPropertyReal(_tz_offset, "tz_offset", Permission::ReadWrite).onSync(CLOUD_WINS).onUpdate(updateTimezoneInfo);
272+
addPropertyReal(_tz_dst_until, "tz_dst_until", Permission::ReadWrite).onSync(CLOUD_WINS).onUpdate(updateTimezoneInfo);
265273

266274
#if OTA_STORAGE_PORTENTA_QSPI
267275
#define BOOTLOADER_ADDR (0x8000000)

0 commit comments

Comments
 (0)