Code: Untitled.c Select all
void send_deviceData(){
//static const char *buff="test";
char buff[100]={"0"};
sprintf(buff,"{'DeviceId':%s,'DeviceName':%s,'Mode':%d,'Power':%d,"
"'ProNum':%s}",deviceData.DeviceId,deviceData.DeviceName,
deviceData.Mode,deviceData.Power,deviceData.ProNum);
while(1){
int err = send(sock, buff, strlen(buff), 0);
if (err < 0) {
ESP_LOGE(TAG, "Error occurred during sending: errno %d", errno);
}
/*
else{
//ESP_LOGE(TAG, "Send bytes success,content");
}
*/
vTaskDelay(2000/portTICK_RATE_MS);
}
vTaskDelete(send_devdahandle);
}Code: Untitled.c Select all
else{
//ESP_LOGE(TAG, "Send bytes success,content");
}Attachment is serial port printing information.