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 fcc_sotp.h Source File

fcc_sotp.h

00001 // ----------------------------------------------------------------------------
00002 // Copyright 2016-2017 ARM Ltd.
00003 //  
00004 // Licensed under the Apache License, Version 2.0 (the "License");
00005 // you may not use this file except in compliance with the License.
00006 // You may obtain a copy of the License at
00007 //  
00008 //     http://www.apache.org/licenses/LICENSE-2.0
00009 //  
00010 // Unless required by applicable law or agreed to in writing, software
00011 // distributed under the License is distributed on an "AS IS" BASIS,
00012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013 // See the License for the specific language governing permissions and
00014 // limitations under the License.
00015 // ----------------------------------------------------------------------------
00016 
00017 #ifndef __FCC_SOTP_H__
00018 #define __FCC_SOTP_H__
00019 
00020 #include "factory_configurator_client.h"
00021 #include "sotp.h"
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 
00028 // Size of factory disabled flag in SOTP - internal use only.
00029 #define FCC_FACTORY_DISABLE_FLAG_SIZE    sizeof(int64_t)
00030 /** Writes data to SOTP
00031 *
00032 * @param data[in]         The data to store in SOTP.
00033 * @param data_size[in]     The size of buf in bytes. Must be divisible by 8, and less than or equal to 1024. Must be according to sotp_type.
00034 * @param sotp_type[in]    Enum representing the type of the item to be stored in SOTP.
00035 *
00036 * @return
00037 *     FCC_STATUS_SUCCESS for success or one of the `::fcc_status_e` errors otherwise.
00038 */
00039 fcc_status_e  fcc_sotp_data_store(const uint8_t *data, size_t data_size, sotp_type_e sotp_type);
00040 
00041 /** Reads data from SOTP
00042 *
00043 * @param data_out[out]             A buffer to retrieve data from SOTP.
00044 * @param data_size_max[in]         The size of data_out max. bytes.
00045 * @param data_actual_size_out[out] The actual size of bytes returned by this function, should be less or equal to data_size_max.
00046 * @param sotp_type[in]             Enum representing the type of the item to be stored in SOTP.
00047 *
00048 * @return
00049 *     FCC_STATUS_SUCCESS for success or one of the `::fcc_status_e` errors otherwise.
00050 */
00051 fcc_status_e  fcc_sotp_data_retrieve(uint8_t *data_out, size_t data_size_max, size_t *data_actual_size_out, sotp_type_e sotp_type);
00052 
00053 
00054 #define MAX_SOTP_BUFFER_SIZE    FCC_ENTROPY_SIZE
00055 
00056 #ifdef __cplusplus
00057 }
00058 #endif
00059 
00060 #endif //__FCC_SOTP_H__