Toyomasa Watarai
/
Mbed-example-WS-W27
simple-mbed-cloud-client/mbed-cloud-client/source/include/CloudClientStorage.h@0:119624335925, 2018-06-30 (annotated)
- Committer:
- MACRUM
- Date:
- Sat Jun 30 01:40:30 2018 +0000
- Revision:
- 0:119624335925
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MACRUM | 0:119624335925 | 1 | // ---------------------------------------------------------------------------- |
MACRUM | 0:119624335925 | 2 | // Copyright 2016-2017 ARM Ltd. |
MACRUM | 0:119624335925 | 3 | // |
MACRUM | 0:119624335925 | 4 | // SPDX-License-Identifier: Apache-2.0 |
MACRUM | 0:119624335925 | 5 | // |
MACRUM | 0:119624335925 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); |
MACRUM | 0:119624335925 | 7 | // you may not use this file except in compliance with the License. |
MACRUM | 0:119624335925 | 8 | // You may obtain a copy of the License at |
MACRUM | 0:119624335925 | 9 | // |
MACRUM | 0:119624335925 | 10 | // http://www.apache.org/licenses/LICENSE-2.0 |
MACRUM | 0:119624335925 | 11 | // |
MACRUM | 0:119624335925 | 12 | // Unless required by applicable law or agreed to in writing, software |
MACRUM | 0:119624335925 | 13 | // distributed under the License is distributed on an "AS IS" BASIS, |
MACRUM | 0:119624335925 | 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
MACRUM | 0:119624335925 | 15 | // See the License for the specific language governing permissions and |
MACRUM | 0:119624335925 | 16 | // limitations under the License. |
MACRUM | 0:119624335925 | 17 | // ---------------------------------------------------------------------------- |
MACRUM | 0:119624335925 | 18 | |
MACRUM | 0:119624335925 | 19 | #ifndef CLOUD_CLIENT_STORAGE_H |
MACRUM | 0:119624335925 | 20 | #define CLOUD_CLIENT_STORAGE_H |
MACRUM | 0:119624335925 | 21 | |
MACRUM | 0:119624335925 | 22 | #define KEY_ACCOUNT_ID "mbed.AccountID" |
MACRUM | 0:119624335925 | 23 | #define KEY_INTERNAL_ENDPOINT "mbed.InternalEndpoint" |
MACRUM | 0:119624335925 | 24 | #define KEY_DEVICE_SOFTWAREVERSION "mbed.SoftwareVersion" |
MACRUM | 0:119624335925 | 25 | #define KEY_FIRST_TO_CLAIM "mbed.FirstToClaim" |
MACRUM | 0:119624335925 | 26 | |
MACRUM | 0:119624335925 | 27 | #ifdef __cplusplus |
MACRUM | 0:119624335925 | 28 | extern "C" { |
MACRUM | 0:119624335925 | 29 | #endif |
MACRUM | 0:119624335925 | 30 | |
MACRUM | 0:119624335925 | 31 | typedef enum { |
MACRUM | 0:119624335925 | 32 | CCS_STATUS_MEMORY_ERROR = -4, |
MACRUM | 0:119624335925 | 33 | CCS_STATUS_VALIDATION_FAIL = -3, |
MACRUM | 0:119624335925 | 34 | CCS_STATUS_KEY_DOESNT_EXIST = -2, |
MACRUM | 0:119624335925 | 35 | CCS_STATUS_ERROR = -1, |
MACRUM | 0:119624335925 | 36 | CCS_STATUS_SUCCESS = 0 |
MACRUM | 0:119624335925 | 37 | } ccs_status_e; |
MACRUM | 0:119624335925 | 38 | |
MACRUM | 0:119624335925 | 39 | /** |
MACRUM | 0:119624335925 | 40 | * \brief Uninitializes the CFStore handle. |
MACRUM | 0:119624335925 | 41 | */ |
MACRUM | 0:119624335925 | 42 | ccs_status_e uninitialize_storage(void); |
MACRUM | 0:119624335925 | 43 | |
MACRUM | 0:119624335925 | 44 | /** |
MACRUM | 0:119624335925 | 45 | * \brief Initializes the CFStore handle. |
MACRUM | 0:119624335925 | 46 | */ |
MACRUM | 0:119624335925 | 47 | ccs_status_e initialize_storage(void); |
MACRUM | 0:119624335925 | 48 | |
MACRUM | 0:119624335925 | 49 | /* Bootstrap credential handling methods */ |
MACRUM | 0:119624335925 | 50 | ccs_status_e get_config_parameter(const char* key, uint8_t *buffer, const size_t buffer_size, size_t *value_length); |
MACRUM | 0:119624335925 | 51 | ccs_status_e get_config_parameter_string(const char* key, uint8_t *buffer, const size_t buffer_size); |
MACRUM | 0:119624335925 | 52 | ccs_status_e set_config_parameter(const char* key, const uint8_t *buffer, const size_t buffer_size); |
MACRUM | 0:119624335925 | 53 | ccs_status_e delete_config_parameter(const char* key); |
MACRUM | 0:119624335925 | 54 | ccs_status_e size_config_parameter(const char* key, size_t* size_out); |
MACRUM | 0:119624335925 | 55 | |
MACRUM | 0:119624335925 | 56 | ccs_status_e get_config_private_key(const char* key, uint8_t *buffer, const size_t buffer_size, size_t *value_length); |
MACRUM | 0:119624335925 | 57 | ccs_status_e set_config_private_key(const char* key, const uint8_t *buffer, const size_t buffer_size); |
MACRUM | 0:119624335925 | 58 | ccs_status_e delete_config_private_key(const char* key); |
MACRUM | 0:119624335925 | 59 | |
MACRUM | 0:119624335925 | 60 | ccs_status_e get_config_public_key(const char* key, uint8_t *buffer, const size_t buffer_size, size_t *value_length); |
MACRUM | 0:119624335925 | 61 | ccs_status_e set_config_public_key(const char* key, const uint8_t *buffer, const size_t buffer_size); |
MACRUM | 0:119624335925 | 62 | ccs_status_e delete_config_public_key(const char* key); |
MACRUM | 0:119624335925 | 63 | |
MACRUM | 0:119624335925 | 64 | ccs_status_e get_config_certificate(const char* key, uint8_t *buffer, const size_t buffer_size, size_t *value_length); |
MACRUM | 0:119624335925 | 65 | ccs_status_e set_config_certificate(const char* key, const uint8_t *buffer, const size_t buffer_size); |
MACRUM | 0:119624335925 | 66 | ccs_status_e delete_config_certificate(const char* key); |
MACRUM | 0:119624335925 | 67 | |
MACRUM | 0:119624335925 | 68 | |
MACRUM | 0:119624335925 | 69 | |
MACRUM | 0:119624335925 | 70 | #ifdef __cplusplus |
MACRUM | 0:119624335925 | 71 | } |
MACRUM | 0:119624335925 | 72 | #endif |
MACRUM | 0:119624335925 | 73 | #endif // CLOUD_CLIENT_STORAGE_H |