/**IPC 5.x useshttp_gw_ipc_custom_msg() interface*IPC 6.x usestuya_http_gw_ipc_custom_msg()interface*/OPERATE_RET test_report_mac_api(){ty_cJSON* result = NULL;CHAR_T buffer[32] = {0};NW_MAC_S buffer_mac;tal_wifi_get_mac(WF_STATION, &buffer_mac);snprintf(buffer, sizeof(buffer), "{\"mac\":\"%02X%02X%02X%02X%02X%02X\"}",buffer_mac.mac[0], buffer_mac.mac[1], buffer_mac.mac[2],buffer_mac.mac[3], buffer_mac.mac[4], buffer_mac.mac[5]);OPERATE_RET ret = tuya_http_gw_ipc_custom_msg("thing.device.mac.report", "1.0", buffer, &result);if(result) {ty_cJSON_Delete(result);}PR_DEBUG("Upload mac %s, ret: %d", buffer, ret);return ret;}
Is this page helpful?
YesFeedbackClick for services and help
Consult
(001)844-672-5646
Submit Question