diff options
author | Inga Stotland <inga.stotland@intel.com> | 2019-12-10 16:56:16 -0800 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2019-12-16 14:52:36 -0800 |
commit | 4a1bea28b15b4ab9b9c962597162cb4070587763 (patch) | |
tree | 5c6cbdc6919d9dfa7fc10912b1ab43997d70467a /mesh/node.c | |
parent | cf0a39476e5f2bb8a4617b7e6482c17f3aafe6ee (diff) | |
download | bluez-4a1bea28b15b4ab9b9c962597162cb4070587763.tar.gz |
mesh: Add mesh-main.conf file with general mesh configuration
This adds key file with default settings for the mesh daemon.
The following settings are included:
Beacon: Default setting for to indicate whether
secure network beaconing is enabled for a
node whose Beacon state hasn't been configured
by a configuration client, i.e., this setting
apllies to a newly provisioned, created or
imported node.
Relay: Default setting for supporting relay
Friendship: Default setting for supporting Friendship
CRPL: Default depth of replay protection list.
FriendQueueSize: Default size of friend queue: the number
of messages that each Friend node can store
for the Low Power node.
ProvTimeout: Provisioning timeout in seconds.
Diffstat (limited to 'mesh/node.c')
-rw-r--r-- | mesh/node.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mesh/node.c b/mesh/node.c index 1f328bd21..be8da8f07 100644 --- a/mesh/node.c +++ b/mesh/node.c @@ -265,12 +265,14 @@ static void add_internal_model(struct mesh_node *node, uint32_t mod_id, static void set_defaults(struct mesh_node *node) { - /* TODO: these values should come from mesh.conf */ node->lpn = MESH_MODE_UNSUPPORTED; node->proxy = MESH_MODE_UNSUPPORTED; - node->friend = MESH_MODE_UNSUPPORTED; - node->beacon = MESH_MODE_DISABLED; - node->relay.mode = MESH_MODE_DISABLED; + node->friend = (mesh_friendship_supported()) ? MESH_MODE_DISABLED : + MESH_MODE_UNSUPPORTED; + node->beacon = (mesh_beacon_enabled()) ? MESH_MODE_ENABLED : + MESH_MODE_DISABLED; + node->relay.mode = (mesh_relay_supported()) ? MESH_MODE_DISABLED : + MESH_MODE_UNSUPPORTED; node->ttl = TTL_MASK; node->seq_number = DEFAULT_SEQUENCE_NUMBER; } @@ -1311,7 +1313,7 @@ static bool get_app_properties(struct mesh_node *node, const char *path, l_debug("path %s", path); node->comp = l_new(struct node_composition, 1); - node->comp->crpl = DEFAULT_CRPL; + node->comp->crpl = mesh_get_crpl(); while (l_dbus_message_iter_next_entry(properties, &key, &variant)) { if (!cid && !strcmp(key, "CompanyID")) { |