Wirepas SDK
wms_settings.h
Go to the documentation of this file.
1 /* Copyright 2019 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 
22 #ifndef APP_LIB_SETTINGS_H_
23 #define APP_LIB_SETTINGS_H_
24 
25 #include <stdlib.h>
26 #include <stdint.h>
27 #include <stdbool.h>
28 
29 #include "wms_app.h"
30 
32 #define APP_LIB_SETTINGS_NAME 0x74ced676
33 
34 
35 #define APP_LIB_SETTINGS_VERSION 0x209
36 
44 #define APP_LIB_SETTINGS_AES_KEY_NUM_BYTES 16
45 
46 // Device address definition is in app/app.h */
47 
53 typedef uint32_t app_lib_settings_net_addr_t;
54 
59 
64 #define CHANNEL_NO_CHANNEL 0
65 
66 typedef enum {
86 
92 typedef uint8_t app_lib_settings_role_t;
93 
115 typedef bool
117 
133 typedef app_res_e
135 
151 typedef app_res_e
153 
166 typedef app_res_e
168 
181 typedef app_res_e
183 
203 typedef app_res_e
204  (*app_lib_settings_set_feature_lock_key_f)(const uint8_t * key_p);
205 
215 typedef app_res_e
217 
231 typedef app_res_e
233 
243 typedef app_res_e
245 
258 typedef app_res_e
260 
269 typedef app_res_e
271 
289 typedef app_res_e
291 
303 typedef app_res_e
305 
330 typedef app_res_e
332 
346 typedef app_res_e
348 
368 typedef app_res_e
369  (*app_lib_settings_set_authentication_key_f)(const uint8_t * key_p);
370 
384 typedef app_res_e
386 
406 typedef app_res_e
407  (*app_lib_settings_set_encryption_key_f)(const uint8_t * key_p);
408 
430 typedef app_res_e
431  (*app_lib_settings_get_ac_range_f)(uint16_t * ac_min_value_p,
432  uint16_t * ac_max_value_p);
433 
481 typedef app_res_e
482  (*app_lib_settings_set_ac_range_f)(uint16_t ac_min_value,
483  uint16_t ac_max_value);
484 
497 typedef app_res_e
498  (*app_lib_settings_get_offline_scan_f)(uint16_t * max_scan_p);
499 
525 typedef app_res_e
526  (*app_lib_settings_set_offline_scan_f)(uint16_t max_scan);
527 
542 typedef app_res_e
544  uint16_t * max_value_p);
545 
560 typedef app_res_e
561  (*app_lib_settings_get_ac_range_limits_f)(uint16_t * min_value_p,
562  uint16_t * max_value_p);
563 
593 typedef app_res_e
595 
619 typedef app_res_e
621  size_t num_bytes);
622 
658 typedef app_res_e
659  (*app_lib_settings_set_reserved_channels_f)(const uint8_t * channels_p,
660  size_t num_bytes);
661 
670 
677 typedef bool (*app_lib_settings_is_valid_network_channel_f)(uint8_t channel);
678 
686 
694 
698 typedef struct
699 {
731 
732 #endif /* APP_LIB_SETTINGS_H_ */
app_lib_settings_t::isValidNetworkAddress
app_lib_settings_is_valid_network_address_f isValidNetworkAddress
Definition: wms_settings.h:726
app_lib_settings_get_reserved_channels_f
app_res_e(* app_lib_settings_get_reserved_channels_f)(uint8_t *channels_p, size_t num_bytes)
Get reserved channels.
Definition: wms_settings.h:620
app_lib_settings_t::registerGroupQuery
app_lib_settings_set_group_query_cb_f registerGroupQuery
Definition: wms_settings.h:723
app_lib_settings_set_network_channel_f
app_res_e(* app_lib_settings_set_network_channel_f)(app_lib_settings_net_channel_t channel)
Set network channel.
Definition: wms_settings.h:290
app_lib_settings_set_authentication_key_f
app_res_e(* app_lib_settings_set_authentication_key_f)(const uint8_t *key_p)
Set authentication key.
Definition: wms_settings.h:369
app_lib_settings_net_channel_t
uint8_t app_lib_settings_net_channel_t
Channel type definition.
Definition: wms_settings.h:58
APP_LIB_SETTINGS_ROLE_SUBNODE_LE
@ APP_LIB_SETTINGS_ROLE_SUBNODE_LE
Definition: wms_settings.h:76
app_lib_settings_set_reserved_channels_f
app_res_e(* app_lib_settings_set_reserved_channels_f)(const uint8_t *channels_p, size_t num_bytes)
Set reserved channels.
Definition: wms_settings.h:659
APP_LIB_SETTINGS_ROLE_ADVERTISER
@ APP_LIB_SETTINGS_ROLE_ADVERTISER
Definition: wms_settings.h:84
app_lib_settings_t::getFeatureLockKey
app_lib_settings_get_feature_lock_key_f getFeatureLockKey
Definition: wms_settings.h:703
app_lib_settings_t::getAuthenticationKey
app_lib_settings_get_authentication_key_f getAuthenticationKey
Definition: wms_settings.h:713
app_lib_settings_set_node_address_f
app_res_e(* app_lib_settings_set_node_address_f)(app_addr_t addr)
Set node address.
Definition: wms_settings.h:232
APP_LIB_SETTINGS_ROLE_HEADNODE_LE
@ APP_LIB_SETTINGS_ROLE_HEADNODE_LE
Definition: wms_settings.h:72
app_lib_settings_t::getAcRange
app_lib_settings_get_ac_range_f getAcRange
Definition: wms_settings.h:717
app_lib_settings_set_offline_scan_f
app_res_e(* app_lib_settings_set_offline_scan_f)(uint16_t max_scan)
Set the maximum offline scan interval in seconds.
Definition: wms_settings.h:526
app_res_e
app_res_e
Definition: wms_app.h:201
app_lib_settings_t::isValidNodeRole
app_lib_settings_is_valid_node_role_f isValidNodeRole
Definition: wms_settings.h:729
app_lib_settings_get_network_address_f
app_res_e(* app_lib_settings_get_network_address_f)(app_lib_settings_net_addr_t *addr_p)
Get network address.
Definition: wms_settings.h:244
app_lib_settings_is_group_cb_f
bool(* app_lib_settings_is_group_cb_f)(app_addr_t group_addr)
Callback used for determining on which multicast groups the device belongs.
Definition: wms_settings.h:116
app_lib_settings_get_ac_range_f
app_res_e(* app_lib_settings_get_ac_range_f)(uint16_t *ac_min_value_p, uint16_t *ac_max_value_p)
Get the access cycle range.
Definition: wms_settings.h:431
wms_app.h
app_lib_settings_get_node_role_f
app_res_e(* app_lib_settings_get_node_role_f)(app_lib_settings_role_t *role_p)
Definition: wms_settings.h:304
app_lib_settings_is_valid_network_channel_f
bool(* app_lib_settings_is_valid_network_channel_f)(uint8_t channel)
Check that the network channel is valid.
Definition: wms_settings.h:677
app_lib_settings_t::getOfflineScan
app_lib_settings_get_offline_scan_f getOfflineScan
Definition: wms_settings.h:719
app_lib_settings_t::setEncryptionKey
app_lib_settings_set_encryption_key_f setEncryptionKey
Definition: wms_settings.h:716
app_lib_settings_get_node_address_f
app_res_e(* app_lib_settings_get_node_address_f)(app_addr_t *addr_p)
Get node address.
Definition: wms_settings.h:216
app_lib_settings_net_addr_t
uint32_t app_lib_settings_net_addr_t
Network address type definition.
Definition: wms_settings.h:53
app_lib_settings_get_network_channel_limits_f
app_res_e(* app_lib_settings_get_network_channel_limits_f)(uint16_t *min_value_p, uint16_t *max_value_p)
Get network channel range.
Definition: wms_settings.h:543
app_lib_settings_t::setNodeRole
app_lib_settings_set_node_role_f setNodeRole
Definition: wms_settings.h:712
app_lib_settings_get_feature_lock_key_f
app_res_e(* app_lib_settings_get_feature_lock_key_f)(uint8_t *key_p)
Check if feature lock key is set.
Definition: wms_settings.h:182
app_lib_settings_get_offline_scan_f
app_res_e(* app_lib_settings_get_offline_scan_f)(uint16_t *max_scan_p)
Get the maximum offline scan interval in seconds.
Definition: wms_settings.h:498
app_lib_settings_reset_all_f
app_res_e(* app_lib_settings_reset_all_f)(void)
Reset all settings to default values.
Definition: wms_settings.h:134
app_lib_settings_get_ac_range_limits_f
app_res_e(* app_lib_settings_get_ac_range_limits_f)(uint16_t *min_value_p, uint16_t *max_value_p)
Get access cycle range limits.
Definition: wms_settings.h:561
app_lib_settings_is_valid_node_role_f
bool(* app_lib_settings_is_valid_node_role_f)(app_lib_settings_role_t role)
Check that the node role is valid.
Definition: wms_settings.h:693
app_lib_settings_set_feature_lock_key_f
app_res_e(* app_lib_settings_set_feature_lock_key_f)(const uint8_t *key_p)
Set feature lock key.
Definition: wms_settings.h:204
app_lib_settings_t::getNetworkChannel
app_lib_settings_get_network_channel_f getNetworkChannel
Definition: wms_settings.h:709
app_lib_settings_t::setNetworkAddress
app_lib_settings_set_network_address_f setNetworkAddress
Definition: wms_settings.h:708
app_lib_settings_t::getReservedChannels
app_lib_settings_get_reserved_channels_f getReservedChannels
Definition: wms_settings.h:724
app_lib_settings_t::getAcRangeLimits
app_lib_settings_get_ac_range_limits_f getAcRangeLimits
Definition: wms_settings.h:722
app_lib_settings_role_e
app_lib_settings_role_e
Definition: wms_settings.h:66
app_lib_settings_set_feature_lock_bits_f
app_res_e(* app_lib_settings_set_feature_lock_bits_f)(uint32_t bits)
Set feature lock bits.
Definition: wms_settings.h:167
app_lib_settings_get_network_channel_f
app_res_e(* app_lib_settings_get_network_channel_f)(app_lib_settings_net_channel_t *channel_p)
Get network channel.
Definition: wms_settings.h:270
app_lib_settings_set_encryption_key_f
app_res_e(* app_lib_settings_set_encryption_key_f)(const uint8_t *key_p)
Set encryption key.
Definition: wms_settings.h:407
app_lib_settings_t::getNodeAddress
app_lib_settings_get_node_address_f getNodeAddress
Definition: wms_settings.h:705
app_lib_settings_t::setNodeAddress
app_lib_settings_set_node_address_f setNodeAddress
Definition: wms_settings.h:706
app_lib_settings_t::getFeatureLockBits
app_lib_settings_get_feature_lock_bits_f getFeatureLockBits
Definition: wms_settings.h:701
app_lib_settings_set_ac_range_f
app_res_e(* app_lib_settings_set_ac_range_f)(uint16_t ac_min_value, uint16_t ac_max_value)
Set range for access cycle.
Definition: wms_settings.h:482
app_lib_settings_set_network_address_f
app_res_e(* app_lib_settings_set_network_address_f)(app_lib_settings_net_addr_t addr)
Set network address.
Definition: wms_settings.h:259
APP_LIB_SETTINGS_ROLE_SINK_LL
@ APP_LIB_SETTINGS_ROLE_SINK_LL
Definition: wms_settings.h:70
app_lib_settings_t::getEncryptionKey
app_lib_settings_get_encryption_key_f getEncryptionKey
Definition: wms_settings.h:715
APP_LIB_SETTINGS_ROLE_AUTOROLE_LE
@ APP_LIB_SETTINGS_ROLE_AUTOROLE_LE
Definition: wms_settings.h:80
app_lib_settings_t::setNetworkChannel
app_lib_settings_set_network_channel_f setNetworkChannel
Definition: wms_settings.h:710
app_lib_settings_get_encryption_key_f
app_res_e(* app_lib_settings_get_encryption_key_f)(uint8_t *key_p)
Check if encryption key is set.
Definition: wms_settings.h:385
app_addr_t
uint32_t app_addr_t
Definition: wms_app.h:228
APP_LIB_SETTINGS_ROLE_SINK_LE
@ APP_LIB_SETTINGS_ROLE_SINK_LE
Definition: wms_settings.h:68
APP_LIB_SETTINGS_ROLE_SUBNODE_LL
@ APP_LIB_SETTINGS_ROLE_SUBNODE_LL
Definition: wms_settings.h:78
app_lib_settings_set_node_role_f
app_res_e(* app_lib_settings_set_node_role_f)(app_lib_settings_role_t role)
Set node role.
Definition: wms_settings.h:331
app_lib_settings_is_valid_network_address_f
bool(* app_lib_settings_is_valid_network_address_f)(app_lib_settings_net_addr_t addr)
Check that the network address is valid.
Definition: wms_settings.h:669
app_lib_settings_t
Definition: wms_settings.h:698
app_lib_settings_t::isValidNodeAddress
app_lib_settings_is_valid_node_address_f isValidNodeAddress
Definition: wms_settings.h:728
app_lib_settings_set_group_query_cb_f
app_res_e(* app_lib_settings_set_group_query_cb_f)(app_lib_settings_is_group_cb_f cb)
Set the callback function for multicat groups.
Definition: wms_settings.h:594
app_lib_settings_t::setFeatureLockKey
app_lib_settings_set_feature_lock_key_f setFeatureLockKey
Definition: wms_settings.h:704
app_lib_settings_role_t
uint8_t app_lib_settings_role_t
Node role type.
Definition: wms_settings.h:92
app_lib_settings_t::getNetworkAddress
app_lib_settings_get_network_address_f getNetworkAddress
Definition: wms_settings.h:707
app_lib_settings_t::setAcRange
app_lib_settings_set_ac_range_f setAcRange
Definition: wms_settings.h:718
app_lib_settings_t::getNetworkChannelLimits
app_lib_settings_get_network_channel_limits_f getNetworkChannelLimits
Definition: wms_settings.h:721
app_lib_settings_t::setReservedChannels
app_lib_settings_set_reserved_channels_f setReservedChannels
Definition: wms_settings.h:725
app_lib_settings_get_feature_lock_bits_f
app_res_e(* app_lib_settings_get_feature_lock_bits_f)(uint32_t *bits_p)
Get feature lock bits.
Definition: wms_settings.h:152
app_lib_settings_is_valid_node_address_f
bool(* app_lib_settings_is_valid_node_address_f)(app_addr_t addr)
Check that the node address is valid.
Definition: wms_settings.h:685
app_lib_settings_t::resetAll
app_lib_settings_reset_all_f resetAll
Definition: wms_settings.h:700
app_lib_settings_t::setFeatureLockBits
app_lib_settings_set_feature_lock_bits_f setFeatureLockBits
Definition: wms_settings.h:702
app_lib_settings_t::getNodeRole
app_lib_settings_get_node_role_f getNodeRole
Definition: wms_settings.h:711
app_lib_settings_t::isValidNetworkChannel
app_lib_settings_is_valid_network_channel_f isValidNetworkChannel
Definition: wms_settings.h:727
APP_LIB_SETTINGS_ROLE_HEADNODE_LL
@ APP_LIB_SETTINGS_ROLE_HEADNODE_LL
Definition: wms_settings.h:74
app_lib_settings_get_authentication_key_f
app_res_e(* app_lib_settings_get_authentication_key_f)(uint8_t *key_p)
Check if authentication key is set.
Definition: wms_settings.h:347
app_lib_settings_t::setAuthenticationKey
app_lib_settings_set_authentication_key_f setAuthenticationKey
Definition: wms_settings.h:714
app_lib_settings_t::setOfflineScan
app_lib_settings_set_offline_scan_f setOfflineScan
Definition: wms_settings.h:720
APP_LIB_SETTINGS_ROLE_AUTOROLE_LL
@ APP_LIB_SETTINGS_ROLE_AUTOROLE_LL
Definition: wms_settings.h:82