#include "compiler.h"
Data Structures | |
struct | _ItemHeader |
struct | _ItemMap |
struct | _PdsFileMarks |
Macros | |
#define | DECLARE_ITEM(RAMADDR, FILEID, ITEMID, SIZE, MEMOFFSET) {.ramAddress = RAMADDR, .fileId = FILEID, .itemId = (ITEMID & 0xFF), .size = SIZE, .itemOffset = MEMOFFSET} |
#define | ITEM_HERADER_MAGIC_NUM 0xa5 |
#define | PDS_DELETE(item) |
#define | PDS_FILE_START_OFFSET 0x00 |
#define | PDS_FILES_VERSION 0x01 |
#define | PDS_MAGIC 0xa5 |
#define | PDS_NVM_VERSION 0x01 |
#define | PDS_RESTORE(item) |
#define | PDS_SIZE_OF_ITEM_HDR sizeof(ItemHeader_t) |
#define | PDS_STORE(item) |
#define | PDS_WL_VERSION 0x01 |
Typedefs | |
typedef struct _ItemHeader | ItemHeader_t |
typedef struct _ItemMap | ItemMap_t |
typedef enum _PdsFileItemIdx | PdsFileItemIdx_t |
typedef struct _PdsFileMarks | PdsFileMarks_t |
typedef enum _PdsOperations | PdsOperations_t |
typedef enum _PdsStatus | PdsStatus_t |
Functions | |
PdsStatus_t | PDS_Delete (PdsFileItemIdx_t pdsFileItemIdx, uint8_t item) |
This function will set the delete operation for the item in the filemask. More... | |
PdsStatus_t | PDS_DeleteAll (void) |
This function will erase all the items stored in the PDS. More... | |
PdsStatus_t | PDS_Init (void) |
Initializes the PDS. More... | |
bool | PDS_IsRestorable (void) |
This function checks if all the registered files are restorable. More... | |
PdsStatus_t | PDS_RegFile (PdsFileItemIdx_t argFileId, PdsFileMarks_t argFileMarks) |
This function registers a file to the PDS. More... | |
PdsStatus_t | PDS_Restore (PdsFileItemIdx_t pdsFileItemIdx, uint8_t item) |
This function will restore an item from PDS to RAM. More... | |
PdsStatus_t | PDS_RestoreAll (void) |
This function will restore all the items from the PDS to RAM from all registered files. More... | |
PdsStatus_t | PDS_Store (PdsFileItemIdx_t pdsFileItemIdx, uint8_t item) |
This function will set the store operation bit in the filemarks for the item in PDS. More... | |
PdsStatus_t | PDS_StoreAll (void) |
This function will set the store operation to all the items stored in all the registered files in PDS. More... | |
PdsStatus_t | PDS_UnInit (void) |
Disables storing to PDS. More... | |
PdsStatus_t | PDS_UnRegFile (PdsFileItemIdx_t argFileId) |
This function un-registers a file to the PDS. More... | |
#define DECLARE_ITEM | ( | RAMADDR, | |
FILEID, | |||
ITEMID, | |||
SIZE, | |||
MEMOFFSET | |||
) | {.ramAddress = RAMADDR, .fileId = FILEID, .itemId = (ITEMID & 0xFF), .size = SIZE, .itemOffset = MEMOFFSET} |
#define ITEM_HERADER_MAGIC_NUM 0xa5 |
#define PDS_DELETE | ( | item | ) |
#define PDS_FILE_START_OFFSET 0x00 |
#define PDS_FILES_VERSION 0x01 |
Referenced by pdsStoreDelete().
#define PDS_MAGIC 0xa5 |
Referenced by pdsStoreDelete(), and pdsWlWrite().
#define PDS_NVM_VERSION 0x01 |
Referenced by pdsNvmWrite().
#define PDS_RESTORE | ( | item | ) |
#define PDS_SIZE_OF_ITEM_HDR sizeof(ItemHeader_t) |
#define PDS_STORE | ( | item | ) |
Referenced by Enableallchannels(), GetTxChannelConfig1(), LORAReg_InitAS(), setDataRange(), setDataRangeT2(), setDefaultTxPower(), setDlFrequency(), setDutyCycle(), setEnableAllChs(), setFrequency(), setJoinSuccess(), UpdateChannelIdStatus(), UpdateChannelIdStatusT2(), UpdateChannelIdStatusT3(), and UpdateChannelIdStatusT4().
#define PDS_WL_VERSION 0x01 |
Referenced by pdsWlWrite().
typedef struct _ItemHeader ItemHeader_t |
typedef enum _PdsFileItemIdx PdsFileItemIdx_t |
typedef struct _PdsFileMarks PdsFileMarks_t |
typedef enum _PdsOperations PdsOperations_t |
typedef enum _PdsStatus PdsStatus_t |
enum _PdsFileItemIdx |
enum _PdsOperations |
enum _PdsStatus |
PdsStatus_t PDS_Delete | ( | PdsFileItemIdx_t | pdsFileItemIdx, |
uint8_t | item | ||
) |
This function will set the delete operation for the item in the filemask.
[in] | pdsFileItemIdx | - The file id to regsiter file to PDS. |
[in] | item | - The item id of the item in PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
This function will set the delete operation for the item in the filemask.
[in] | pdsFileItemIdx | - The file id to register file to PDS. |
[in] | item | - The item id of the item in PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References _PdsFileMarks::fileMarkListAddr, isFileSet, PDS_INVLIAD_FILE_IDX, PDS_MAX_FILE_IDX, PDS_OK, PDS_OP_DELETE, PDS_STORE_DELETE_TASK_ID, pdsPostTask(), and pdsUnInitFlag.
PdsStatus_t PDS_DeleteAll | ( | void | ) |
This function will erase all the items stored in the PDS.
[out] | status | - The return status of the function's operation. |
References PDS_OK, pdsUnInitFlag, and pdsWlDeleteAll().
Referenced by enddevice_cpc_execute_command(), and processRunDemoApp().
PdsStatus_t PDS_Init | ( | void | ) |
Initializes the PDS.
[in] | none | |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References PDS_OK, pdsUnInitFlag, and pdsWlInit().
bool PDS_IsRestorable | ( | void | ) |
This function checks if all the registered files are restorable.
[out] | status | - The return status of the function's operation. |
References isFileFound(), PDS_MAX_FILE_IDX, and pdsUnInitFlag.
Referenced by mote_demo_init().
PdsStatus_t PDS_RegFile | ( | PdsFileItemIdx_t | argFileId, |
PdsFileMarks_t | argFileMarks | ||
) |
This function registers a file to the PDS.
[in] | argFileId | - The file id to register file to PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References PDS_INVLIAD_FILE_IDX, PDS_MAX_FILE_IDX, PDS_OK, and pdsUnInitFlag.
Referenced by LORAReg_InitAS(), LORAReg_InitAU(), LORAReg_InitEU(), LORAReg_InitIN(), LORAReg_InitJP(), LORAReg_InitKR(), and LORAReg_InitNA().
PdsStatus_t PDS_Restore | ( | PdsFileItemIdx_t | pdsFileItemIdx, |
uint8_t | item | ||
) |
This function will restore an item from PDS to RAM.
[in] | pdsFileItemIdx | - The file id to regsiter file to PDS. |
[in] | item | - The item id of the item in PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
[in] | pdsFileItemIdx | - The file id to register file to PDS. |
[in] | item | - The item id of the item in PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References buffer, _ItemHeader::delete, _ItemMap::itemId, _ItemMap::itemOffset, _PdsNvm_t::NVM_Struct, PDS_INVLIAD_FILE_IDX, PDS_ITEM_DELETED, PDS_NOT_FOUND, PDS_OK, _PdsNvm_t::_NVM_Struct::pdsNvmData, pdsUnInitFlag, _PdsWl_t::_WL_Struct::pdsWlData, pdsWlRead(), ptr, _ItemMap::ramAddress, _ItemMap::size, and _PdsWl_t::WL_Struct.
PdsStatus_t PDS_RestoreAll | ( | void | ) |
This function will restore all the items from the PDS to RAM from all registered files.
[out] | status | - The return status of the function's operation. |
References buffer, _ItemHeader::delete, _PdsFileMarks::fIDcb, _ItemMap::itemOffset, NULL, _PdsFileMarks::numItems, _PdsNvm_t::NVM_Struct, PDS_MAX_FILE_IDX, PDS_OK, _PdsNvm_t::_NVM_Struct::pdsNvmData, pdsUnInitFlag, _PdsWl_t::_WL_Struct::pdsWlData, pdsWlRead(), ptr, _ItemMap::ramAddress, _ItemHeader::size, _ItemMap::size, and _PdsWl_t::WL_Struct.
Referenced by cert_app_init(), enddevice_cpc_fresh_join(), mote_demo_init(), and processRunRestoreBand().
PdsStatus_t PDS_Store | ( | PdsFileItemIdx_t | pdsFileItemIdx, |
uint8_t | item | ||
) |
This function will set the store operation bit in the filemarks for the item in PDS.
[in] | pdsFileItemIdx | - The file id to regsiter file to PDS. |
[in] | item | - The item id of the item in PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
This function will set the store operation bit in the filemarks for the item in PDS.
[in] | pdsFileItemIdx | - The file id to register file to PDS. |
[in] | item | - The item id of the item in PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References _PdsFileMarks::fileMarkListAddr, isFileSet, PDS_INVLIAD_FILE_IDX, PDS_MAX_FILE_IDX, PDS_OK, PDS_OP_STORE, PDS_STORE_DELETE_TASK_ID, pdsPostTask(), and pdsUnInitFlag.
PdsStatus_t PDS_StoreAll | ( | void | ) |
This function will set the store operation to all the items stored in all the registered files in PDS.
[in] | none | |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References _PdsFileMarks::fileMarkListAddr, isFileSet, _PdsFileMarks::numItems, PDS_MAX_FILE_IDX, PDS_OK, PDS_OP_STORE, PDS_STORE_DELETE_TASK_ID, pdsPostTask(), and pdsUnInitFlag.
Referenced by demo_joindata_callback().
PdsStatus_t PDS_UnInit | ( | void | ) |
Disables storing to PDS.
[in] | none | |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References PDS_OK, and pdsUnInitFlag.
PdsStatus_t PDS_UnRegFile | ( | PdsFileItemIdx_t | argFileId | ) |
This function un-registers a file to the PDS.
[in] | argFileId | - The file id to un-register file to PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
This function un-registers a file to the PDS.
[in] | argFileId | - The file id to register file to PDS. |
[out] | status | - The return status of the function's operation of type PdsStatus_t. |
References PDS_INVLIAD_FILE_IDX, PDS_MAX_FILE_IDX, PDS_OK, and pdsUnInitFlag.
Referenced by LORAREG_UnInit().