Update data_template_event.c

修复提交单事件时拼接的json多出一个“{”符号
This commit is contained in:
blackwhite084
2020-01-27 14:43:28 +08:00
committed by GitHub
parent ace83f22c0
commit 87298ea3e3

View File

@@ -305,7 +305,7 @@ static int _iot_construct_event_json(void *handle, char *jsonBuffer, size_t size
}else{ //single
sEvent *pEvent = pEventArry[0];
if(0 == pEvent->timestamp){ //no accurate UTC time, set 0
rc_of_snprintf = HAL_Snprintf(jsonBuffer + strlen(jsonBuffer), remain_size, "{\"eventId\":\"%s\", \"type\":\"%s\", \"timestamp\":0, \"params\":{",\
rc_of_snprintf = HAL_Snprintf(jsonBuffer + strlen(jsonBuffer), remain_size, "\"eventId\":\"%s\", \"type\":\"%s\", \"timestamp\":0, \"params\":{",\
pEvent->event_name, pEvent->type);
}else{ // accurate UTC time is second,change to ms
rc_of_snprintf = HAL_Snprintf(jsonBuffer + strlen(jsonBuffer), remain_size, "\"eventId\":\"%s\", \"type\":\"%s\", \"timestamp\":%u000, \"params\":{",\