Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上报设备信息的方式 #12

Open
jackeyycl opened this issue Nov 20, 2020 · 0 comments
Open

上报设备信息的方式 #12

jackeyycl opened this issue Nov 20, 2020 · 0 comments

Comments

@jackeyycl
Copy link

参考下面上报设备信息,在连连app,产品信息中只能看到固件版本是对应上的,厂家信息名称,产品型号,mac地址都是空的。请问这些的key值是什么?如何报上去,谢谢。

static int _get_sys_info(void *handle, char *pJsonDoc, size_t sizeOfBuffer)
{
/platform info has at least one of module_hardinfo/module_softinfo/fw_ver property/
DeviceProperty platform_info[] = {
{.key = "module_hardinfo", .type = TYPE_TEMPLATE_STRING, .data = "ESP32"},
{.key = "module_softinfo", .type = TYPE_TEMPLATE_STRING, .data = "V1.0"},
{.key = "fw_ver", .type = TYPE_TEMPLATE_STRING, .data = QCLOUD_IOT_DEVICE_SDK_VERSION},
{.key = "imei", .type = TYPE_TEMPLATE_STRING, .data = "11-22-33-44"},
{.key = "lat", .type = TYPE_TEMPLATE_STRING, .data = "22.546015"},
{.key = "lon", .type = TYPE_TEMPLATE_STRING, .data = "113.941125"},
{.key = NULL, .data = NULL} // end
};

/*self define info*/
DeviceProperty self_info[] = {
    {.key = "append_info", .type = TYPE_TEMPLATE_STRING, .data = "ESP8266 test board demo"},
    {.key = NULL, .data = NULL}  // end
};
return IOT_Template_JSON_ConstructSysInfo(handle, pJsonDoc, sizeOfBuffer, platform_info, self_info);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant