Toyomasa Watarai
/
Mbed-example-WS-W27
Mbed Cloud example program for workshop in W27 2018.
Embed:
(wiki syntax)
Show/hide line numbers
arm_uc_types.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 ARM_UPDATE_COMMON_TYPES_H 00020 #define ARM_UPDATE_COMMON_TYPES_H 00021 00022 #include <stdint.h> 00023 00024 typedef struct 00025 { 00026 uint32_t size_max; // maximum size of the buffer 00027 uint32_t size; // index of the first empty byte in the buffer 00028 uint8_t* ptr; // pointer to buffer's memory 00029 } arm_uc_buffer_t; 00030 00031 typedef enum { 00032 URI_SCHEME_NONE, 00033 URI_SCHEME_HTTP, 00034 } arm_uc_uri_scheme_t; 00035 00036 typedef struct 00037 { 00038 uint32_t size_max; // maximum size of the buffer 00039 uint32_t size; // index of the first empty byte in the buffer 00040 uint8_t* ptr; // pointer to buffer's memory 00041 arm_uc_uri_scheme_t scheme; // URI type 00042 uint16_t port; // connection port 00043 char* host; // \0 terminated string with host name 00044 char* path; // \0 terminated string with resource path 00045 } arm_uc_uri_t; 00046 00047 #define ARM_UC_GUID_SIZE (128/8) 00048 #define ARM_UC_SHA256_SIZE (256/8) 00049 #define ARM_UC_SHA512_SIZE (512/8) 00050 #define ARM_UC_AES256_KEY_SIZE (256/8) 00051 #define ARM_UC_AES_BLOCK_SIZE (128/8) 00052 00053 /** 00054 * @brief GUID type 00055 */ 00056 typedef uint8_t arm_uc_guid_t[ARM_UC_GUID_SIZE]; 00057 00058 /** 00059 * @brief SHA256 hash 00060 */ 00061 typedef uint8_t arm_uc_hash_t[ARM_UC_SHA256_SIZE]; 00062 00063 /** 00064 * @brief Firmware details struct. 00065 * @details Struct for passing information between the Update client and the 00066 * PAAL implementation describing the firmware image. 00067 */ 00068 typedef struct _arm_uc_firmware_details_t 00069 { 00070 uint64_t version; 00071 uint64_t size; 00072 arm_uc_hash_t hash; 00073 arm_uc_guid_t campaign; 00074 uint32_t signatureSize; 00075 uint8_t signature[0]; 00076 } arm_uc_firmware_details_t; 00077 00078 /** 00079 * @brief Installer details struct. 00080 * @details Struct for reading the installer information. 00081 */ 00082 typedef struct _arm_uc_installer_details_t 00083 { 00084 arm_uc_hash_t arm_hash; 00085 arm_uc_hash_t oem_hash; 00086 uint32_t layout; 00087 } arm_uc_installer_details_t; 00088 00089 #endif // ARM_UPDATE_COMMON_TYPES_H
Generated on Tue Jul 12 2022 16:22:04 by 1.7.2