mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2025-05-20 08:38:04 +08:00
add update param to SendIotDescriptors
This commit is contained in:
@ -89,6 +89,7 @@ void Protocol::SendIotDescriptors(const std::string& descriptors) {
|
|||||||
cJSON* messageRoot = cJSON_CreateObject();
|
cJSON* messageRoot = cJSON_CreateObject();
|
||||||
cJSON_AddStringToObject(messageRoot, "session_id", session_id_.c_str());
|
cJSON_AddStringToObject(messageRoot, "session_id", session_id_.c_str());
|
||||||
cJSON_AddStringToObject(messageRoot, "type", "iot");
|
cJSON_AddStringToObject(messageRoot, "type", "iot");
|
||||||
|
cJSON_AddBoolToObject(messageRoot, "update", true);
|
||||||
|
|
||||||
cJSON* descriptorArray = cJSON_CreateArray();
|
cJSON* descriptorArray = cJSON_CreateArray();
|
||||||
cJSON_AddItemToArray(descriptorArray, cJSON_Duplicate(descriptor, 1));
|
cJSON_AddItemToArray(descriptorArray, cJSON_Duplicate(descriptor, 1));
|
||||||
|
Reference in New Issue
Block a user