AWSIoTSubscribeDeviceShadow (FB)¶
FUNCTION_BLOCK AWSIoTSubscribeDeviceShadow
Function block to subscribe for changes of the device shadow.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xEnable
BOOL
TRUE: Subscribes device shadow changes, FALSE: Unsubscribe
pbPayload
POINTER TO BYTE
Pointer to the receive buffer (device shadow delta)
udiMaxPayloadSize
UDINT
Maximum size of the receive buffer
eQoS
Quality of service level (QoS)
sClientId
REFERENCE TO STRING(255)
0
The name of another thing. The input sClientId can be used to access device shadows of other things. if 0, then the clientId from AWSIoTClient will be used.
mQTTSubscribeProperties
REFERENCE TO MQTTSubscribeProperties
Subscribe proerties (MQTT V5 only)
udiTimeout
UDINT
1000000
Time in µs in which an subcription acknowledgement (SUBACK) must be received.
Inout
awsIoTClient
Reference to AWSIoTClient
Output
xError
BOOL
TRUE, if an error occurred
xBusy
BOOL
TRUE, while is subscribed
eError
MQTT.MQTT_ERROR
Error code
xReceived
BOOL
TRUE, if the device shadow has been changed
xSubscribeActive
BOOL
FALSE
FALSE: When there is no active subscription, TRUE: Subscriber is listening
udiPayloadSize
UDINT
Length of the device shadow delta
mQTTPublishProperties
Last received publish properties