Binary data storage
With GCP, device state data is always stored as a base64-encoded representation of the raw data bytes. This differs with ClearBlade IoT Core whenever the state data contains non-printable characters (i.e., the data is not a string). In that case, the text data representation holds a HEX string representing the raw data bytes. Extracting the raw data from the HEX string requires using the Python bytes.fromhex()
function (or equivalent in other languages). When using the cloudiot_devices_states API to retrieve binary states, the base64Encode
query param should be excluded or set to false
to receive a response containing the above HEX string.