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 0x208
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 
304 typedef app_res_e
306 
331 typedef app_res_e
333 
347 typedef app_res_e
349 
369 typedef app_res_e
370  (*app_lib_settings_set_authentication_key_f)(const uint8_t * key_p);
371 
385 typedef app_res_e
387 
407 typedef app_res_e
408  (*app_lib_settings_set_encryption_key_f)(const uint8_t * key_p);
409 
431 typedef app_res_e
432  (*app_lib_settings_get_ac_range_f)(uint16_t * ac_min_value_p,
433  uint16_t * ac_max_value_p);
434 
482 typedef app_res_e
483  (*app_lib_settings_set_ac_range_f)(uint16_t ac_min_value,
484  uint16_t ac_max_value);
485 
498 typedef app_res_e
499  (*app_lib_settings_get_offline_scan_f)(uint16_t * max_scan_p);
500 
526 typedef app_res_e
527  (*app_lib_settings_set_offline_scan_f)(uint16_t max_scan);
528 
543 typedef app_res_e
545  uint16_t * max_value_p);
546 
561 typedef app_res_e
562  (*app_lib_settings_get_ac_range_limits_f)(uint16_t * min_value_p,
563  uint16_t * max_value_p);
564 
594 typedef app_res_e
596 
620 typedef app_res_e
622  size_t num_bytes);
623 
662 typedef app_res_e
663  (*app_lib_settings_set_reserved_channels_f)(const uint8_t * channels_p,
664  size_t num_bytes);
665 
674 
682 
690 
698 
702 typedef struct
703 {
735 
736 #endif /* APP_LIB_SETTINGS_H_ */
app_lib_settings_t::isValidNetworkAddress
app_lib_settings_is_valid_network_address_f isValidNetworkAddress
Definition: wms_settings.h:730
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:621
app_lib_settings_t::registerGroupQuery
app_lib_settings_set_group_query_cb_f registerGroupQuery
Definition: wms_settings.h:727
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:370
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:663
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:707
app_lib_settings_t::getAuthenticationKey
app_lib_settings_get_authentication_key_f getAuthenticationKey
Definition: wms_settings.h:717
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_joining_received_beacon_s::channel
app_lib_settings_net_channel_t channel
Definition: wms_joining.h:149
app_lib_settings_t::getAcRange
app_lib_settings_get_ac_range_f getAcRange
Definition: wms_settings.h:721
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:527
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:733
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:432
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:305
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:681
app_lib_settings_t::getOfflineScan
app_lib_settings_get_offline_scan_f getOfflineScan
Definition: wms_settings.h:723
app_lib_settings_t::setEncryptionKey
app_lib_settings_set_encryption_key_f setEncryptionKey
Definition: wms_settings.h:720
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:544
app_lib_settings_t::setNodeRole
app_lib_settings_set_node_role_f setNodeRole
Definition: wms_settings.h:716
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:499
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:562
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:697
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:713
app_lib_settings_t::setNetworkAddress
app_lib_settings_set_network_address_f setNetworkAddress
Definition: wms_settings.h:712
app_lib_settings_t::getReservedChannels
app_lib_settings_get_reserved_channels_f getReservedChannels
Definition: wms_settings.h:728
app_lib_settings_t::getAcRangeLimits
app_lib_settings_get_ac_range_limits_f getAcRangeLimits
Definition: wms_settings.h:726
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:408
app_lib_settings_t::getNodeAddress
app_lib_settings_get_node_address_f getNodeAddress
Definition: wms_settings.h:709
app_lib_settings_t::setNodeAddress
app_lib_settings_set_node_address_f setNodeAddress
Definition: wms_settings.h:710
app_lib_settings_t::getFeatureLockBits
app_lib_settings_get_feature_lock_bits_f getFeatureLockBits
Definition: wms_settings.h:705
app_lib_joining_received_beacon_s::addr
app_lib_settings_net_addr_t addr
Definition: wms_joining.h:147
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:483
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:719
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:714
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:386
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:332
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:673
app_lib_settings_t
Definition: wms_settings.h:702
app_lib_settings_t::isValidNodeAddress
app_lib_settings_is_valid_node_address_f isValidNodeAddress
Definition: wms_settings.h:732
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:595
app_lib_settings_t::setFeatureLockKey
app_lib_settings_set_feature_lock_key_f setFeatureLockKey
Definition: wms_settings.h:708
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:711
app_lib_settings_t::setAcRange
app_lib_settings_set_ac_range_f setAcRange
Definition: wms_settings.h:722
app_lib_settings_t::getNetworkChannelLimits
app_lib_settings_get_network_channel_limits_f getNetworkChannelLimits
Definition: wms_settings.h:725
app_lib_settings_t::setReservedChannels
app_lib_settings_set_reserved_channels_f setReservedChannels
Definition: wms_settings.h:729
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:689
app_lib_settings_t::resetAll
app_lib_settings_reset_all_f resetAll
Definition: wms_settings.h:704
app_lib_joining_received_beacon_s::num_bytes
size_t num_bytes
Definition: wms_joining.h:137
app_lib_settings_t::setFeatureLockBits
app_lib_settings_set_feature_lock_bits_f setFeatureLockBits
Definition: wms_settings.h:706
app_lib_settings_t::getNodeRole
app_lib_settings_get_node_role_f getNodeRole
Definition: wms_settings.h:715
app_lib_settings_t::isValidNetworkChannel
app_lib_settings_is_valid_network_channel_f isValidNetworkChannel
Definition: wms_settings.h:731
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:348
app_lib_settings_t::setAuthenticationKey
app_lib_settings_set_authentication_key_f setAuthenticationKey
Definition: wms_settings.h:718
app_lib_settings_t::setOfflineScan
app_lib_settings_set_offline_scan_f setOfflineScan
Definition: wms_settings.h:724
APP_LIB_SETTINGS_ROLE_AUTOROLE_LL
@ APP_LIB_SETTINGS_ROLE_AUTOROLE_LL
Definition: wms_settings.h:82