Simple interface for Mbed Cloud Client
Embed:
(wiki syntax)
Show/hide line numbers
arm_uc_source_http.h
00001 // ---------------------------------------------------------------------------- 00002 // Copyright 2016-2017 ARM Ltd. 00003 // 00004 // SPDX-License-Identifier: Apache-2.0 00005 // 00006 // Licensed under the Apache License, Version 2.0 (the "License"); 00007 // you may not use this file except in compliance with the License. 00008 // You may obtain a copy of the License at 00009 // 00010 // http://www.apache.org/licenses/LICENSE-2.0 00011 // 00012 // Unless required by applicable law or agreed to in writing, software 00013 // distributed under the License is distributed on an "AS IS" BASIS, 00014 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 // See the License for the specific language governing permissions and 00016 // limitations under the License. 00017 // ---------------------------------------------------------------------------- 00018 00019 #ifndef __UPDATE_CLIENT_SOURCE_HTTP_H__ 00020 #define __UPDATE_CLIENT_SOURCE_HTTP_H__ 00021 00022 #include "update-client-source/arm_uc_source.h" 00023 00024 /** 00025 * @brief Get driver version. 00026 * @return Driver version. 00027 */ 00028 uint32_t ARM_UCS_GetVersion(void); 00029 00030 /** 00031 * @brief Get Source capabilities. 00032 * @return Struct containing capabilites. See definition above. 00033 */ 00034 ARM_SOURCE_CAPABILITIES ARM_UCS_GetCapabilities(void); 00035 00036 /** 00037 * @brief Initialize Source. 00038 * @details Function pointer to event handler is passed as argument. 00039 * 00040 * @param cb_event Function pointer to event handler. See events above. 00041 * @return Error code. 00042 */ 00043 arm_uc_error_t ARM_UCS_Initialize(ARM_SOURCE_SignalEvent_t cb_event); 00044 00045 /** 00046 * @brief Uninitialized Source. 00047 * @return Error code. 00048 */ 00049 arm_uc_error_t ARM_UCS_Uninitialize(void); 00050 00051 /** 00052 * @brief Cost estimation for retrieving manifest from the default location. 00053 * @details The estimation can vary over time and should not be cached too long. 00054 * 0x00000000 - The manifest is already downloaded. 00055 * 0xFFFFFFFF - Cannot retrieve manifest from this Source. 00056 * 00057 * @param cost Pointer to variable for the return value. 00058 * @return Error code. 00059 */ 00060 arm_uc_error_t ARM_UCS_GetManifestDefaultCost(uint32_t* cost); 00061 00062 /** 00063 * @brief Cost estimation for retrieving manifest from URL. 00064 * @details The estimation can vary over time and should not be cached too long. 00065 * 0x00000000 - The manifest is already downloaded. 00066 * 0xFFFFFFFF - Cannot retrieve manifest from this Source. 00067 * 00068 * @param uri URI struct with manifest location. 00069 * @param cost Pointer to variable for the return value. 00070 * @return Error code. 00071 */ 00072 arm_uc_error_t ARM_UCS_GetManifestURLCost(arm_uc_uri_t* uri, uint32_t* cost); 00073 00074 /** 00075 * @brief Cost estimation for retrieving firmware from URL. 00076 * @details The estimation can vary over time and should not be cached too long. 00077 * 0x00000000 - The firmware is already downloaded. 00078 * 0xFFFFFFFF - Cannot retrieve firmware from this Source. 00079 * 00080 * @param uri URI struct with firmware location. 00081 * @param cost Pointer to variable for the return value. 00082 * @return Error code. 00083 */ 00084 arm_uc_error_t ARM_UCS_GetFirmwareURLCost(arm_uc_uri_t* uri, uint32_t* cost); 00085 00086 /** 00087 * @brief Cost estimation for retrieving key table from URL. 00088 * @details The estimation can vary over time and should not be cached too long. 00089 * 0x00000000 - The firmware is already downloaded. 00090 * 0xFFFFFFFF - Cannot retrieve firmware from this Source. 00091 * 00092 * @param uri URI struct with keytable location. 00093 * @param cost Pointer to variable for the return value. 00094 * @return Error code. 00095 */ 00096 arm_uc_error_t ARM_UCS_GetKeytableURLCost(arm_uc_uri_t* uri, uint32_t* cost); 00097 00098 /** 00099 * @brief Retrieve manifest from the default location. 00100 * @details Manifest is stored in supplied buffer. 00101 * Event is generated once manifest is in buffer. 00102 * 00103 * @param buffer Struct containing byte array, maximum size, and actual size. 00104 * @param offset Manifest offset in bytes where the requested fragment begins. 00105 * @return Error code. 00106 */ 00107 arm_uc_error_t ARM_UCS_GetManifestDefault(arm_uc_buffer_t* buffer, uint32_t offset); 00108 00109 /** 00110 * @brief Retrieve manifest from URL. 00111 * @details Manifest is stored in supplied buffer. 00112 * Event is generated once manifest is in buffer. 00113 * 00114 * @param uri URI struct with manifest location. 00115 * @param buffer Struct containing byte array, maximum size, and actual size. 00116 * @param offset Manifest offset in bytes where the requested fragment begins. 00117 * 00118 * @return Error code. 00119 */ 00120 arm_uc_error_t ARM_UCS_GetManifestURL(arm_uc_uri_t* uri, arm_uc_buffer_t* buffer, uint32_t offset); 00121 00122 /** 00123 * @brief Retrieve firmware fragment. 00124 * @details Firmware fragment is stored in supplied buffer. 00125 * Event is generated once fragment is in buffer. 00126 * 00127 * @param uri URI struct with firmware location. 00128 * @param buffer Struct containing byte array, maximum size, and actual size. 00129 * @param offset Firmware offset to retrieve fragment from. 00130 * @return Error code. 00131 */ 00132 arm_uc_error_t ARM_UCS_GetFirmwareFragment(arm_uc_uri_t* uri, arm_uc_buffer_t* buffer, uint32_t offset); 00133 00134 /** 00135 * @brief Retrieve a key table from a URL. 00136 * @details Key table is stored in supplied buffer. 00137 * Event is generated once fragment is in buffer. 00138 * 00139 * @param uri URI struct with keytable location. 00140 * @param buffer Struct containing byte array, maximum size, and actual size. 00141 * @return Error code. 00142 */ 00143 arm_uc_error_t ARM_UCS_GetKeytableURL(arm_uc_uri_t* uri, arm_uc_buffer_t* buffer); 00144 00145 extern ARM_UPDATE_SOURCE ARM_UCS_HTTPSource; 00146 00147 #endif // __UPDATE_CLIENT_SOURCE_HTTP_H__
Generated on Tue Jul 12 2022 19:01:33 by 1.7.2