Simulated product dispenser

Dependencies:   HTS221

Fork of mbed-cloud-workshop-connect-HTS221 by Jim Carver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers arm_uc_types.h Source File

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 #define ARM_UC_ROT_SIZE        (128/8)
00053 #define ARM_UC_DEVICE_KEY_SIZE (256/8)
00054 
00055 #define ARM_UC_DEVICE_HMAC_KEY "StorageEnc256HMACSHA256SIGNATURE"
00056 #define ARM_UC_DEVICE_HMAC_KEY_SIZE (sizeof(ARM_UC_DEVICE_HMAC_KEY) - 1)
00057 
00058 /**
00059  * @brief GUID type
00060  */
00061 typedef uint8_t arm_uc_guid_t[ARM_UC_GUID_SIZE];
00062 
00063 /**
00064  * @brief SHA256 hash
00065  */
00066 typedef uint8_t arm_uc_hash_t[ARM_UC_SHA256_SIZE];
00067 
00068 /**
00069  * @brief Firmware details struct.
00070  * @details Struct for passing information between the Update client and the
00071  *          PAAL implementation describing the firmware image.
00072  */
00073 typedef struct _arm_uc_firmware_details_t
00074 {
00075     uint64_t version;
00076     uint64_t size;
00077     arm_uc_hash_t hash;
00078     arm_uc_guid_t campaign;
00079     uint32_t signatureSize;
00080     uint8_t signature[0];
00081 } arm_uc_firmware_details_t;
00082 
00083 /**
00084  * @brief Installer details struct.
00085  * @details Struct for reading the installer information.
00086  */
00087 typedef struct _arm_uc_installer_details_t
00088 {
00089     arm_uc_hash_t arm_hash;
00090     arm_uc_hash_t oem_hash;
00091     uint32_t layout;
00092 } arm_uc_installer_details_t;
00093 
00094 #endif // ARM_UPDATE_COMMON_TYPES_H