Azure IoT 中心 C sdk blob 上传示例可能没有低级别 API?
Azure IoT hub C sdk blob upload example possible without low level API?
我正在尝试来自 Azure IoT 中心 C SDK 的 iothub_client/samples/iothub_client_sample_upload_to_blob。如果我使用低级 API,它编译并工作正常。
但是一旦我切换到便利层(如应用程序文件中的文档所建议的那样),我就会收到错误消息:
/home/user/workspaceMisc/azure-iot-sdk-c/iothub_client/samples/iothub_client_sample_upload_to_blob/iothub_client_sample_upload_to_blob.c: In function ‘iothub_client_sample_upload_to_blob_run’:
/home/user/workspaceMisc/azure-iot-sdk-c/iothub_client/samples/iothub_client_sample_upload_to_blob/iothub_client_sample_upload_to_blob.c:77:25: error: implicit declaration of function ‘IoTHubClient_UploadToBlob’ [-Werror=implicit-function-declaration]
if (IoTHubClient_UploadToBlob(iotHubClientHandle, "subdir/hello_world.txt", (const unsigned char*)HELLO_WORLD, sizeof(HELLO_WORLD) - 1) != IOTHUB_CLIENT_OK)
^
cc1: all warnings being treated as errors
iothub_client/samples/iothub_client_sample_upload_to_blob/CMakeFiles/iothub_client_sample_upload_to_blob.dir/build.make:62: recipe for target 'iothub_client/samples/iothub_client_sample_upload_to_blob/CMakeFiles/iothub_client_sample_upload_to_blob.dir/iothub_client_sample_upload_to_blob.c.o' failed
如何使用便利层而不是低层上传文件?有可能吗?
我正在使用 Ubuntu 16.04、gcc 5.4.0 和最新的 SDK 克隆。
实际上函数名是IoTHubClient_UploadToBlobAsync
,你需要添加Async后缀。并且需要额外的两个参数:iotHubClientFileUploadCallback
和 context
。 This document 有点误导。
所以你可以这样调用这个函数:
IoTHubClient_UploadToBlobAsync(iotHubClientHandle, "subdir/hello_world.txt", (const unsigned char*)HELLO_WORLD, sizeof(HELLO_WORLD) - 1, NULL, NULL);
我正在尝试来自 Azure IoT 中心 C SDK 的 iothub_client/samples/iothub_client_sample_upload_to_blob。如果我使用低级 API,它编译并工作正常。 但是一旦我切换到便利层(如应用程序文件中的文档所建议的那样),我就会收到错误消息:
/home/user/workspaceMisc/azure-iot-sdk-c/iothub_client/samples/iothub_client_sample_upload_to_blob/iothub_client_sample_upload_to_blob.c: In function ‘iothub_client_sample_upload_to_blob_run’:
/home/user/workspaceMisc/azure-iot-sdk-c/iothub_client/samples/iothub_client_sample_upload_to_blob/iothub_client_sample_upload_to_blob.c:77:25: error: implicit declaration of function ‘IoTHubClient_UploadToBlob’ [-Werror=implicit-function-declaration]
if (IoTHubClient_UploadToBlob(iotHubClientHandle, "subdir/hello_world.txt", (const unsigned char*)HELLO_WORLD, sizeof(HELLO_WORLD) - 1) != IOTHUB_CLIENT_OK)
^
cc1: all warnings being treated as errors
iothub_client/samples/iothub_client_sample_upload_to_blob/CMakeFiles/iothub_client_sample_upload_to_blob.dir/build.make:62: recipe for target 'iothub_client/samples/iothub_client_sample_upload_to_blob/CMakeFiles/iothub_client_sample_upload_to_blob.dir/iothub_client_sample_upload_to_blob.c.o' failed
如何使用便利层而不是低层上传文件?有可能吗?
我正在使用 Ubuntu 16.04、gcc 5.4.0 和最新的 SDK 克隆。
实际上函数名是IoTHubClient_UploadToBlobAsync
,你需要添加Async后缀。并且需要额外的两个参数:iotHubClientFileUploadCallback
和 context
。 This document 有点误导。
所以你可以这样调用这个函数:
IoTHubClient_UploadToBlobAsync(iotHubClientHandle, "subdir/hello_world.txt", (const unsigned char*)HELLO_WORLD, sizeof(HELLO_WORLD) - 1, NULL, NULL);