gpt4 book ai didi

c - 使用 json 在 ibmiot cloud 中发布事件

转载 作者:太空宇宙 更新时间:2023-11-04 04:24:31 25 4
gpt4 key购买 nike

我想使用c语言将加速度计数据发送到IBM iot cloud。

在此我使用 json 格式在云中发布事件。

char *data="{\"d\": {\"x\": 43 }}";//工作正常..

我想通过这个指针以 JSON 格式发送即时值。请帮助我如何在 IBMIOTf 客户端使用 JSON 格式发送即时值

最佳答案

如果您使用 IBMIOTfclient (iotfclient.h),您可以调用 publishEvent,例如:

publishEvent(&client, "accel","json", "{\"d\": {\"x\": 43 }}", QOS0);

github中有一个示例.

关于c - 使用 json 在 ibmiot cloud 中发布事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43042436/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com