Wirepas SDK
|
Go to the source code of this file.
Typedefs | |
typedef void(* | shared_app_config_received_cb_f) (uint16_t type, uint8_t length, uint8_t *value_p) |
The app config type reception callback. More... | |
Functions | |
shared_app_config_res_e | Shared_Appconfig_init (void) |
Initialize the shared app config library. More... | |
shared_app_config_res_e | Shared_Appconfig_addFilter (shared_app_config_filter_t *filter, uint16_t *filter_id) |
Add a new app config type filter to the list. If the item is already in the list it is only updated. More... | |
shared_app_config_res_e | Shared_Appconfig_removeFilter (uint16_t filter_id) |
Remove a received packet item from the list. Removed item fields are all set to 0. More... | |
shared_app_config_res_e | Shared_Appconfig_setAppConfig (const uint8_t *bytes) |
Set a new app config. More... | |
shared_app_config_res_e | Shared_Appconfig_notifyAppConfig (const uint8_t *bytes) |
Notify other modules of a new app config received. More... | |
Data Structures | |
struct | shared_app_config_filter_t |
Structure holding all parameters for app config type filtering. More... | |
Enumerations | |
enum | shared_app_config_res_e { SHARED_APP_CONFIG_RES_OK = 0, SHARED_APP_CONFIG_RES_NO_FILTER = 1, SHARED_APP_CONFIG_RES_INVALID_PARAM = 2, SHARED_APP_CONFIG_RES_INVALID_FILTER = 3, SHARED_APP_CONFIG_RES_UNINITIALIZED = 4, SHARED_APP_CONFIG_RES_INVALID_ROLE = 5 } |
List of return code. More... | |
Macros | |
#define | SHARED_APP_CONFIG_ALL_TYPE_FILTER 0xFFFF |
Value to use to receive all types. More... | |
#define | SHARED_APP_CONFIG_INCOMPATIBLE_FILTER 0xFFFE |
Value to use to receive incompatible raw app_config Ie, if the app config is not recognized by this library, the complete raw app config is sent to registered modules. More... | |
typedef void(* shared_app_config_received_cb_f) (uint16_t type, uint8_t length, uint8_t *value_p) |
The app config type reception callback.
This is the callback called when a new app config is received and a matching type is present in the content.
type | The type that match the filtering |
length | The length of this TLV entry. |
value_p | Pointer to the value of the TLV |
Definition at line 59 of file shared_appconfig.h.
shared_app_config_res_e Shared_Appconfig_addFilter | ( | shared_app_config_filter_t * | filter, |
uint16_t * | filter_id | ||
) |
Add a new app config type filter to the list. If the item is already in the list it is only updated.
filter | New filter (type + cb) |
filter_id | Filter id to be used with Shared_Appconfig_removeTypeReceivedCb. Set only if return code is SHARED_APP_CONFIG_RES_OK |
shared_app_config_res_e Shared_Appconfig_init | ( | void | ) |
Initialize the shared app config library.
shared_app_config_res_e Shared_Appconfig_notifyAppConfig | ( | const uint8_t * | bytes | ) |
Notify other modules of a new app config received.
bytes | Pointer to app config to notify. |
shared_app_config_res_e Shared_Appconfig_removeFilter | ( | uint16_t | filter_id | ) |
Remove a received packet item from the list. Removed item fields are all set to 0.
filter_id | filter to remove. |
shared_app_config_res_e Shared_Appconfig_setAppConfig | ( | const uint8_t * | bytes | ) |
Set a new app config.
bytes | Pointer to app config data to write. |
struct shared_app_config_filter_t |
Structure holding all parameters for app config type filtering.
Definition at line 64 of file shared_appconfig.h.
Data Fields | ||
---|---|---|
bool | call_cb_always |
If set to true, the cb will be called everytime an app_config is received, even if the type is not present. If it happens, cb will have length set to 0 and value_p set to NULL |
shared_app_config_received_cb_f | cb |
Will be called when the received app_config contains a matching type If the type is SHARED_APP_CONFIG_ALL_TYPE_FILTER the callback will be called multiple times |
uint16_t | type |
Type for this filter. valid range [0;(2^16-1)], -1: to receive all types |
List of return code.
Definition at line 15 of file shared_appconfig.h.
#define SHARED_APP_CONFIG_ALL_TYPE_FILTER 0xFFFF |
Value to use to receive all types.
Definition at line 36 of file shared_appconfig.h.
#define SHARED_APP_CONFIG_INCOMPATIBLE_FILTER 0xFFFE |
Value to use to receive incompatible raw app_config Ie, if the app config is not recognized by this library, the complete raw app config is sent to registered modules.
Definition at line 43 of file shared_appconfig.h.