|
TuyaOS
|
tuya key-value database module 更多...
#include "tuya_cloud_types.h"

结构体 | |
| struct | TY_DB_RW_S |
| tuya key-value database property, used for serialize/deserialize data to json format 更多... | |
宏定义 | |
| #define | VT_BOOL 5 |
| #define | VT_BYTE 1 |
| #define | VT_CHAR 0 |
| #define | VT_INT 4 |
| #define | VT_RAW 7 |
| #define | VT_SHORT 2 |
| #define | VT_STRING 6 |
| #define | VT_USHORT 3 |
类型定义 | |
| typedef BYTE_T | VAR_TP_T |
| tuya key-value database property define, used for serialize/deserialize data to json format | |
函数 | |
| OPERATE_RET | wd_common_delete (IN CONST CHAR_T *key) |
| delete the entry from key-value database 更多... | |
| OPERATE_RET | wd_common_exist (IN CONST CHAR_T *key, OUT BOOL_T *exist) |
| check the entry from key-value database 更多... | |
| OPERATE_RET | wd_common_free_data (IN BYTE_T *data) |
| free the buffer which allocated by wd_common_read or wd_common_fuzzy_read 更多... | |
| OPERATE_RET | wd_common_fuzzy_delete (IN CONST CHAR_T *key) |
| fuzzy delete the entry from key-value database 更多... | |
| OPERATE_RET | wd_common_fuzzy_read (IN CONST CHAR_T *fuzzy_name, INOUT UINT_T *index, OUT BYTE_T **data, OUT UINT_T *len) |
| tuya key-value database fuzzy read entry 更多... | |
| OPERATE_RET | wd_common_read (IN CONST CHAR_T *key, OUT BYTE_T **value, OUT UINT_T *p_len) |
| tuya key-value database read entry 更多... | |
| OPERATE_RET | wd_common_write (IN CONST CHAR_T *key, IN CONST BYTE_T *value, IN CONST UINT_T len) |
| tuya key-value database write entry 更多... | |
| OPERATE_RET | wd_protected_delete (IN CONST CHAR_T *key) |
| delete the entry from protected storage 更多... | |
| OPERATE_RET | wd_protected_read (IN CONST CHAR_T *key, OUT BYTE_T **value, OUT UINT_T *p_len) |
| tuya protected storage read entry 更多... | |
| OPERATE_RET | wd_protected_write (IN CONST CHAR_T *key, IN CONST BYTE_T *value, IN CONST UINT_T len) |
| tuya protected storage write entry 更多... | |
| OPERATE_RET | wd_user_param_read (OUT BYTE_T **buf, OUT UINT_T *len) |
| read the user parameter from tuya key-value database 更多... | |
| OPERATE_RET | wd_user_param_write (IN CONST BYTE_T *data, IN CONST UINT_T len) |
| write the user parameter to tuya key-value database 更多... | |
| OPERATE_RET | wd_utils_deserialize (IN CONST CHAR_T *in, INOUT TY_DB_RW_S *rw, IN CONST UINT_T rw_cnt) |
| tuya key-value deserialize, transfer the data from json format to property array 更多... | |
| OPERATE_RET | wd_utils_free_outbuf (IN CHAR_T *out_buf) |
| free the buffer which allocated by wd_utils_serialize_restore 更多... | |
| OPERATE_RET | wd_utils_serialize (IN CONST TY_DB_RW_S *rw, IN CONST UINT_T rw_cnt, OUT CHAR_T **out, OUT UINT_T *out_len) |
| tuya key-value serialize, transfer the data from TY_DB_RW_S array to json format 更多... | |
| OPERATE_RET | wd_utils_serialize_restore (IN CONST CHAR_T *key, INOUT TY_DB_RW_S *rw, IN CONST UINT_T rw_cnt) |
| tuya key-value serialize restore, will read the data from tuya key-value database and restore to database property entry 更多... | |
| OPERATE_RET | wd_utils_serialize_save (IN CONST CHAR_T *key, IN CONST TY_DB_RW_S *rw, IN CONST UINT_T rw_cnt) |
| tuya key-value serialize and save in tuya key-value database 更多... | |
| OPERATE_RET | ws_db_format (VOID) |
| tuya key-value database format 更多... | |
| CHAR_T * | ws_db_get_storage_path (VOID) |
| tuya key-value database get storage path 更多... | |
| OPERATE_RET | ws_db_init (IN CONST CHAR_T *fs_storge_path, IN CONST BYTE_T *p_key) |
| tuya key-value database initialization 更多... | |
| OPERATE_RET | ws_db_init_mf (VOID) |
| tuya key-value database initialization in mf 更多... | |
| OPERATE_RET | ws_db_rebuild (VOID) |
| tuya key-value database rebuild to recycle 更多... | |
| VOID | ws_db_uninit (VOID) |
| tuya key-value database de-initialization 更多... | |
tuya key-value database module
| OPERATE_RET wd_common_delete | ( | IN CONST CHAR_T * | key | ) |
delete the entry from key-value database
| [in] | key | key of the entry you want to delete |
| OPERATE_RET wd_common_exist | ( | IN CONST CHAR_T * | key, |
| OUT BOOL_T * | exist | ||
| ) |
check the entry from key-value database
| [in] | key | key of the entry you want to check |
| [OUT] | exist TRUE on exist |
| OPERATE_RET wd_common_free_data | ( | IN BYTE_T * | data | ) |
free the buffer which allocated by wd_common_read or wd_common_fuzzy_read
| [in] | data | the buffer got from wd_common_read or wd_common_fuzzy_read |
| OPERATE_RET wd_common_fuzzy_delete | ( | IN CONST CHAR_T * | key | ) |
fuzzy delete the entry from key-value database
| [in] | key | key of the entry you want to delete |
| OPERATE_RET wd_common_fuzzy_read | ( | IN CONST CHAR_T * | fuzzy_name, |
| INOUT UINT_T * | index, | ||
| OUT BYTE_T ** | data, | ||
| OUT UINT_T * | len | ||
| ) |
tuya key-value database fuzzy read entry
| [in] | fuzzy_name | key of the entry you want to read |
| [in] | index | index of the value sequnence |
| [out] | data | buffer of the value |
| [out] | p_len | length of the buffer |
| OPERATE_RET wd_common_read | ( | IN CONST CHAR_T * | key, |
| OUT BYTE_T ** | value, | ||
| OUT UINT_T * | p_len | ||
| ) |
tuya key-value database read entry
| [in] | key | key of the entry you want to read |
| [out] | value | buffer of the value |
| [out] | p_len | length of the buffer |
| OPERATE_RET wd_common_write | ( | IN CONST CHAR_T * | key, |
| IN CONST BYTE_T * | value, | ||
| IN CONST UINT_T | len | ||
| ) |
tuya key-value database write entry
| [in] | key | key of the entry you want to write |
| [in] | value | value buffer you want to write |
| [in] | len | the numbers of byte you want to write |
| OPERATE_RET wd_protected_delete | ( | IN CONST CHAR_T * | key | ) |
delete the entry from protected storage
| [in] | key | key of the entry you want to delete |
| OPERATE_RET wd_protected_read | ( | IN CONST CHAR_T * | key, |
| OUT BYTE_T ** | value, | ||
| OUT UINT_T * | p_len | ||
| ) |
tuya protected storage read entry
| [in] | key | key of the entry you want to read |
| [out] | value | buffer of the value |
| [out] | p_len | length of the buffer |
| OPERATE_RET wd_protected_write | ( | IN CONST CHAR_T * | key, |
| IN CONST BYTE_T * | value, | ||
| IN CONST UINT_T | len | ||
| ) |
tuya protected storage write entry
| [in] | key | key of the entry you want to write |
| [in] | value | value buffer you want to write |
| [in] | len | the numbers of byte you want to write |
| OPERATE_RET wd_user_param_read | ( | OUT BYTE_T ** | buf, |
| OUT UINT_T * | len | ||
| ) |
read the user parameter from tuya key-value database
| [out] | buf | buffer of the data |
| [out] | len | length of the data |
| OPERATE_RET wd_user_param_write | ( | IN CONST BYTE_T * | data, |
| IN CONST UINT_T | len | ||
| ) |
write the user parameter to tuya key-value database
| [in] | data | buffer of the data |
| [in] | len | length of the data |
| OPERATE_RET wd_utils_deserialize | ( | IN CONST CHAR_T * | in, |
| INOUT TY_DB_RW_S * | rw, | ||
| IN CONST UINT_T | rw_cnt | ||
| ) |
tuya key-value deserialize, transfer the data from json format to property array
| [in] | in | the json format data |
| [in,out] | rw | the database entry which contains a property array |
| [in,out] | rw_cnt | the database entry property array count |
| OPERATE_RET wd_utils_free_outbuf | ( | IN CHAR_T * | out_buf | ) |
free the buffer which allocated by wd_utils_serialize_restore
| out_buf | the buffer got from wd_utils_serialize_restore |
| OPERATE_RET wd_utils_serialize | ( | IN CONST TY_DB_RW_S * | rw, |
| IN CONST UINT_T | rw_cnt, | ||
| OUT CHAR_T ** | out, | ||
| OUT UINT_T * | out_len | ||
| ) |
tuya key-value serialize, transfer the data from TY_DB_RW_S array to json format
| [in] | rw | the database entry which contains a property array |
| [in] | rw_cnt | the database entry property array count |
| [out] | out | the serialized json format buffer |
| [out] | out_len | the serialized json format length |
| OPERATE_RET wd_utils_serialize_restore | ( | IN CONST CHAR_T * | key, |
| INOUT TY_DB_RW_S * | rw, | ||
| IN CONST UINT_T | rw_cnt | ||
| ) |
tuya key-value serialize restore, will read the data from tuya key-value database and restore to database property entry
| [in] | key | key of the database entry |
| [in,out] | rw | the database entry which contains a property array |
| [in,out] | rw_cnt | the database entry property array count |
| OPERATE_RET wd_utils_serialize_save | ( | IN CONST CHAR_T * | key, |
| IN CONST TY_DB_RW_S * | rw, | ||
| IN CONST UINT_T | rw_cnt | ||
| ) |
tuya key-value serialize and save in tuya key-value database
| [in] | key | key of the database entry |
| [in] | rw | the database entry which contains a property array |
| [in] | rw_cnt | the database entry property array count |
| OPERATE_RET ws_db_format | ( | VOID | ) |
tuya key-value database format
| CHAR_T * ws_db_get_storage_path | ( | VOID | ) |
tuya key-value database get storage path
| OPERATE_RET ws_db_init | ( | IN CONST CHAR_T * | fs_storge_path, |
| IN CONST BYTE_T * | p_key | ||
| ) |
tuya key-value database initialization
| [in] | fs_storge_path | the storage path of the key-value database, only used in linux system |
| [in] | p_key | the encypto key of the key-value database, if p_key==NULL, will generate a random one |
| OPERATE_RET ws_db_init_mf | ( | VOID | ) |
tuya key-value database initialization in mf
| OPERATE_RET ws_db_rebuild | ( | VOID | ) |
tuya key-value database rebuild to recycle
| VOID ws_db_uninit | ( | VOID | ) |
tuya key-value database de-initialization