Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: azure_umqtt_c iothub_mqtt_transport mbed-rtos mbed wolfSSL Socket lwip-eth lwip-sys lwip
blob.h
00001 // Copyright (c) Microsoft. All rights reserved. 00002 // Licensed under the MIT license. See LICENSE file in the project root for full license information. 00003 00004 /** @file blob.h 00005 * @brief Contains blob APIs needed for File Upload feature of IoTHub client. 00006 * 00007 * @details IoTHub client needs to upload a byte array by using blob storage API 00008 * IoTHub service provides the complete SAS URI to execute a PUT request 00009 * that will upload the data. 00010 * 00011 */ 00012 00013 #ifndef BLOB_H 00014 #define BLOB_H 00015 00016 #include "azure_c_shared_utility/macro_utils.h" 00017 #include "azure_c_shared_utility/buffer_.h" 00018 00019 #ifdef __cplusplus 00020 #include <cstddef> 00021 extern "C" 00022 { 00023 #else 00024 #include <stddef.h> 00025 #endif 00026 00027 #include "azure_c_shared_utility/umock_c_prod.h" 00028 00029 #define BLOB_RESULT_VALUES \ 00030 BLOB_OK, \ 00031 BLOB_ERROR, \ 00032 BLOB_NOT_IMPLEMENTED, \ 00033 BLOB_HTTP_ERROR, \ 00034 BLOB_INVALID_ARG 00035 00036 DEFINE_ENUM(BLOB_RESULT, BLOB_RESULT_VALUES) 00037 00038 /** 00039 * @brief Synchronously uploads a byte array to blob storage 00040 * 00041 * @param SASURI The URI to use to upload data 00042 * @param size The size of the data to be uploaded (can be 0) 00043 * @param source A pointer to the byte array to be uploaded (can be NULL, but then size needs to be zero) 00044 * @param httpStatus A pointer to an out argument receiving the HTTP status (available only when the return value is BLOB_OK) 00045 * @param httpResponse A BUFFER_HANDLE that receives the HTTP response from the server (available only when the return value is BLOB_OK) 00046 * 00047 * @return A @c BLOB_RESULT. BLOB_OK means the blob has been uploaded successfully. Any other value indicates an error 00048 */ 00049 MOCKABLE_FUNCTION(, BLOB_RESULT, Blob_UploadFromSasUri,const char*, SASURI, const unsigned char*, source, size_t, size, unsigned int*, httpStatus, BUFFER_HANDLE, httpResponse) 00050 00051 #ifdef __cplusplus 00052 } 00053 #endif 00054 00055 #endif /* BLOB_H */
Generated on Wed Jul 13 2022 07:19:04 by
 1.7.2