Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/manifest-manager/update-client-manifest-manager/arm-pal-kv.h@0:8f0bb79ddd48, 2021-05-04 (annotated)
- Committer:
- leothedragon
- Date:
- Tue May 04 08:55:12 2021 +0000
- Revision:
- 0:8f0bb79ddd48
nmn
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
leothedragon | 0:8f0bb79ddd48 | 1 | // ---------------------------------------------------------------------------- |
leothedragon | 0:8f0bb79ddd48 | 2 | // Copyright 2016-2017 ARM Ltd. |
leothedragon | 0:8f0bb79ddd48 | 3 | // |
leothedragon | 0:8f0bb79ddd48 | 4 | // SPDX-License-Identifier: Apache-2.0 |
leothedragon | 0:8f0bb79ddd48 | 5 | // |
leothedragon | 0:8f0bb79ddd48 | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); |
leothedragon | 0:8f0bb79ddd48 | 7 | // you may not use this file except in compliance with the License. |
leothedragon | 0:8f0bb79ddd48 | 8 | // You may obtain a copy of the License at |
leothedragon | 0:8f0bb79ddd48 | 9 | // |
leothedragon | 0:8f0bb79ddd48 | 10 | // http://www.apache.org/licenses/LICENSE-2.0 |
leothedragon | 0:8f0bb79ddd48 | 11 | // |
leothedragon | 0:8f0bb79ddd48 | 12 | // Unless required by applicable law or agreed to in writing, software |
leothedragon | 0:8f0bb79ddd48 | 13 | // distributed under the License is distributed on an "AS IS" BASIS, |
leothedragon | 0:8f0bb79ddd48 | 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
leothedragon | 0:8f0bb79ddd48 | 15 | // See the License for the specific language governing permissions and |
leothedragon | 0:8f0bb79ddd48 | 16 | // limitations under the License. |
leothedragon | 0:8f0bb79ddd48 | 17 | // ---------------------------------------------------------------------------- |
leothedragon | 0:8f0bb79ddd48 | 18 | |
leothedragon | 0:8f0bb79ddd48 | 19 | #ifndef ARM_PAL_KV_H |
leothedragon | 0:8f0bb79ddd48 | 20 | #define ARM_PAL_KV_H |
leothedragon | 0:8f0bb79ddd48 | 21 | |
leothedragon | 0:8f0bb79ddd48 | 22 | #include <stdint.h> |
leothedragon | 0:8f0bb79ddd48 | 23 | #include <stddef.h> |
leothedragon | 0:8f0bb79ddd48 | 24 | |
leothedragon | 0:8f0bb79ddd48 | 25 | #ifdef __cplusplus |
leothedragon | 0:8f0bb79ddd48 | 26 | extern "C" { |
leothedragon | 0:8f0bb79ddd48 | 27 | #endif |
leothedragon | 0:8f0bb79ddd48 | 28 | |
leothedragon | 0:8f0bb79ddd48 | 29 | |
leothedragon | 0:8f0bb79ddd48 | 30 | #define ARM_PAL_KV_KEY_MAX_PATH 220 |
leothedragon | 0:8f0bb79ddd48 | 31 | |
leothedragon | 0:8f0bb79ddd48 | 32 | typedef struct arm_pal_key_value_api { |
leothedragon | 0:8f0bb79ddd48 | 33 | uint32_t (*keySize)(); |
leothedragon | 0:8f0bb79ddd48 | 34 | void (*keyInit)(void *key); |
leothedragon | 0:8f0bb79ddd48 | 35 | |
leothedragon | 0:8f0bb79ddd48 | 36 | int32_t (*Close)(void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 37 | int32_t (*Create)(const char *key_name, size_t value_len, const void *kdesc, void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 38 | int32_t (*Delete)(void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 39 | int32_t (*Find)(const char *key_name_query, const void *previous, void *next); |
leothedragon | 0:8f0bb79ddd48 | 40 | int32_t (*Flush)(void); |
leothedragon | 0:8f0bb79ddd48 | 41 | int32_t (*GetKeyName)(void *hkey, char *key_name, uint8_t *key_len); |
leothedragon | 0:8f0bb79ddd48 | 42 | int32_t (*GetValueLen)(void *hkey, size_t *value_len); |
leothedragon | 0:8f0bb79ddd48 | 43 | int32_t (*Initialize)( |
leothedragon | 0:8f0bb79ddd48 | 44 | void(*callback)(int32_t status, int32_t cmd_code, void *client_context, void *handle), |
leothedragon | 0:8f0bb79ddd48 | 45 | void *client_context); |
leothedragon | 0:8f0bb79ddd48 | 46 | int32_t (*PowerControl)(uint32_t state); |
leothedragon | 0:8f0bb79ddd48 | 47 | int32_t (*Read)(void *hkey, void *data, size_t *len); |
leothedragon | 0:8f0bb79ddd48 | 48 | int32_t (*Open)(const char *key_name, uint32_t flags, void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 49 | int32_t (*Rseek)(void *hkey, size_t offset); |
leothedragon | 0:8f0bb79ddd48 | 50 | int32_t (*Uninitialize)(void); |
leothedragon | 0:8f0bb79ddd48 | 51 | int32_t (*Write)(void *hkey, const char *data, size_t *len); |
leothedragon | 0:8f0bb79ddd48 | 52 | } arm_pal_key_value_api; |
leothedragon | 0:8f0bb79ddd48 | 53 | |
leothedragon | 0:8f0bb79ddd48 | 54 | |
leothedragon | 0:8f0bb79ddd48 | 55 | #define ARM_PAL_KV_OPENMODE_RD (1 << 3) |
leothedragon | 0:8f0bb79ddd48 | 56 | |
leothedragon | 0:8f0bb79ddd48 | 57 | uint32_t ARM_PAL_KV_keySize(const arm_pal_key_value_api *api); |
leothedragon | 0:8f0bb79ddd48 | 58 | void ARM_PAL_KV_keyInit(const arm_pal_key_value_api *api, void *key); |
leothedragon | 0:8f0bb79ddd48 | 59 | int32_t ARM_PAL_KV_Close(const arm_pal_key_value_api *api, void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 60 | int32_t ARM_PAL_KV_Create(const arm_pal_key_value_api *api, const char *key_name, size_t value_len, const void *kdesc, |
leothedragon | 0:8f0bb79ddd48 | 61 | void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 62 | int32_t ARM_PAL_KV_Delete(const arm_pal_key_value_api *api, void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 63 | int32_t ARM_PAL_KV_Find(const arm_pal_key_value_api *api, const char *key_name_query, const void *previous, void *next); |
leothedragon | 0:8f0bb79ddd48 | 64 | int32_t ARM_PAL_KV_Flush(const arm_pal_key_value_api *api); |
leothedragon | 0:8f0bb79ddd48 | 65 | int32_t ARM_PAL_KV_GetKeyName(const arm_pal_key_value_api *api, void *hkey, char *key_name, uint8_t *key_len); |
leothedragon | 0:8f0bb79ddd48 | 66 | int32_t ARM_PAL_KV_GetValueLen(const arm_pal_key_value_api *api, void *hkey, size_t *value_len); |
leothedragon | 0:8f0bb79ddd48 | 67 | int32_t ARM_PAL_KV_Initialize(const arm_pal_key_value_api *api, void(*callback)(int32_t status, int32_t cmd_code, |
leothedragon | 0:8f0bb79ddd48 | 68 | void *client_context, void *handle), void *client_context); |
leothedragon | 0:8f0bb79ddd48 | 69 | int32_t ARM_PAL_KV_PowerControl(const arm_pal_key_value_api *api, uint32_t state); |
leothedragon | 0:8f0bb79ddd48 | 70 | int32_t ARM_PAL_KV_Read(const arm_pal_key_value_api *api, void *hkey, void *data, size_t *len); |
leothedragon | 0:8f0bb79ddd48 | 71 | int32_t ARM_PAL_KV_Open(const arm_pal_key_value_api *api, const char *key_name, uint32_t flags, void *hkey); |
leothedragon | 0:8f0bb79ddd48 | 72 | int32_t ARM_PAL_KV_Rseek(const arm_pal_key_value_api *api, void *hkey, size_t offset); |
leothedragon | 0:8f0bb79ddd48 | 73 | int32_t ARM_PAL_KV_Uninitialize(const arm_pal_key_value_api *api); |
leothedragon | 0:8f0bb79ddd48 | 74 | int32_t ARM_PAL_KV_Write(const arm_pal_key_value_api *api, void *hkey, const char *data, size_t *len); |
leothedragon | 0:8f0bb79ddd48 | 75 | |
leothedragon | 0:8f0bb79ddd48 | 76 | |
leothedragon | 0:8f0bb79ddd48 | 77 | |
leothedragon | 0:8f0bb79ddd48 | 78 | |
leothedragon | 0:8f0bb79ddd48 | 79 | #ifdef __cplusplus |
leothedragon | 0:8f0bb79ddd48 | 80 | } |
leothedragon | 0:8f0bb79ddd48 | 81 | #endif |
leothedragon | 0:8f0bb79ddd48 | 82 | |
leothedragon | 0:8f0bb79ddd48 | 83 | |
leothedragon | 0:8f0bb79ddd48 | 84 | #endif // ARM_PAL_KV_H |