Commit Graph

534 Commits

Author SHA1 Message Date
Inga Stotland
ef7e484855 mesh: Send correct NetKey index in DevKeyMessageReceived
The value of net_index in DevKeyMessageReceived() method must be set
to the value of a subnet index on which a device key encoded message
has been received. Was hard coded to 0. Fixed.
2020-08-20 07:28:46 -07:00
Inga Stotland
b50c299a29 mesh: Check for enabled modes when dst is fixed address
This moves the check for incoming messages addressed to fixed addresses,
e.g. RELAY, PROXY, FRIEND. If the corresponding feature is not enabled,
the message is not processed.
2020-08-20 07:27:00 -07:00
Inga Stotland
bff0b258e3 mesh: Always set net modes based on node feature settings
The network settings such as relay, beacon, proxy and friend are
always set based on local node feature settings. This change makes
the net modes initialization unconditional, to include the "No Support"
setting on node level which should result in the disabled mode in net.c
2020-08-20 07:26:28 -07:00
Brian Gix
8ecfe3221a mesh: fix double-free of outbound tx data
Due to the asyncronous multi-step process to send a packet on an HCI
socket, an outbound packet could be superseded before send procedure
is completed. This change ensures that at any stage in the process,
that the pointer to the packet has been fully disposed.
2020-08-14 12:18:59 -07:00
Inga Stotland
602e4c0ff9 mesh: Don't add config server when loading from storage
Adding a sonfig server model when loading from storage is unnecessary,
since the daemon-generated stored configuration always contains
config server model.
This also fixes a memory leak caused by bad parameters passed to
mesh_model_add()
2020-08-13 15:07:01 -07:00
Inga Stotland
2614f2b732 mesh: Make mesh config model binding API consistent
This changes the order of function arguments in
mesh_config_model_binding_add() and mesh_config_model_binding_del()
to make them consistent with the rest of mesh_config_model... APIs
2020-08-13 15:04:03 -07:00
Inga Stotland
8ea7d58428 mesh: Fix model ID prior to calling mesh config functions
Model IDs for SIG defined models need to be stripped off SIG_VENDOR
value used for internal housekeeping prior to calling functions
that save new model state in node configuration.

Also, remove duplicate statements for model lookup in node config.
2020-08-13 15:04:03 -07:00
Michał Lowas-Rzechonek
fd45d85ad9 mesh: Fix encoding of Config Key Refresh Phase Status
Config Key Refresh Phase Status is 4 octets long (see Mesh Profile
v1.0.1, section 4.3.2.60): 1 octet for status, 2 octets for net key
index, 1 octet for the phase.
2020-08-12 09:26:37 -07:00
Inga Stotland
14b109f1fb mesh: Fix logic error when saving model subscriptions
This fixes opcode check condition when saving configuration for model
subscriptions: use || instead of && for opcode checking
2020-08-11 11:09:56 -07:00
Inga Stotland
d3691ce6b0 mesh: Fix element index look up for config model subs
Use element address for looking up element index (subscription
address was erroneously used to perform the lookup).
2020-08-11 09:35:03 -07:00
Michał Lowas-Rzechonek
32f2c108d1 mesh: Fix application key binding lookup
Because l_queue_find can't distinguish between entry->data equal to zero
and missing entry, has_binding() fails when we bind app key with index
0, via L_UINT_TO_PTR.

Bug has been introduced in commit 1a2a6debd
2020-08-11 07:36:29 -07:00
Inga Stotland
c77bb848a9 mesh: Refactor heartbeat pub/sub
Move heartbeat publication/subscription timers and housekeeping
to net.c since this is where the trigger events and control messages
are handled. Configuration server (cfgmod-server.c) stays
responsible for parsing the set pub/sub message parameters and
assemblying the pub/sub status messages.

Also, make sure that the correct message status is reported.
2020-08-10 14:48:55 -07:00
Inga Stotland
1836a4e09e mesh: Clean up handling of config KR phase messages
This modification allows using a single point for sending out
the composed status messages by the Config Server.

Also, this checks for the correct relationship between KR transition
and KR phase values. Correct error codes are sent on unsuccessful
requests and malformed requests are ignored.
2020-08-10 14:47:09 -07:00
Inga Stotland
639dabe1c2 mesh: Clean up handling of config net transmit messages
This modification allows using a single point for sending out
the composed status messages by the Config Server.
2020-08-10 14:47:09 -07:00
Inga Stotland
91d25c115d mesh: Clean up handling of config poll timeout message
This modification allows using a single point for sending out
the composed status messages by the Config Server.
2020-08-10 14:47:09 -07:00
Inga Stotland
531806c353 mesh: Clean up handling of config relay messages
This modification allows using a single point for sending out
the composed status messages by the Config Server.
2020-08-10 14:47:09 -07:00
Inga Stotland
000cd8e3c3 mesh: Clean up handling of config net and app key messages
This modification allows using a single point for sending out
the composed status messages by the Config Server.
2020-08-10 14:47:09 -07:00
Inga Stotland
14572fe1c5 mesh: Clean up handling of config publication messages
This modification allows using a single point for sending out
the composed status messages by the Config Server.

Also, return Feature Not Supported errror code when credential
flag is set, but the node does not support LPN feature
2020-08-10 14:47:09 -07:00
Inga Stotland
72f85660fb mesh: Clean up handling of config node identity message
This modification allows using a single point for sending out
the composed status messages by the Config Server.
2020-08-10 14:47:08 -07:00
Inga Stotland
1a2a6debd0 mesh: Clean up handling of config model binding messages
This modification allows using a single point for sending out
the composed status messages by the Config Server.

Also, remove unused definitions for binding functions in node.h
2020-08-10 14:47:08 -07:00
Inga Stotland
5a12b9b757 mesh: Clean up handling of config subscription messages
This provides better functional grouping based on whether a group or
a virtual label is used for the subscription address.

Also, use a single point for sending out the composed Config Server
status messages.
2020-08-10 14:47:08 -07:00
Inga Stotland
ca5dfd4ea0 mesh: Use correct TTL value to send model publication
When sending model publishing data, use TTL value configured for
that publication instead of the default TTL value used for regular
messages.
2020-08-07 07:36:18 -07:00
Michał Lowas-Rzechonek
347117afd8 mesh: Allow deleting non-existing net key
When deleting a non-existing key, first check that it doesn't exist (and
return success), then verify it's not the last key we have.
2020-08-06 15:46:57 -07:00
Michał Lowas-Rzechonek
7b25497cc8 mesh: Allow deleting non-existing app key
Mesh Profile v1.0.1, section 4.3.2.40 Config AppKey Status

(...) The Status Code shall be Success if the received request was
redundant (add of an identical existing key, update of an identical
updated key, or delete of a non-existent key), with no further action
taken.
2020-08-06 15:46:57 -07:00
Inga Stotland
e170ce6fba mesh: Fix calculation of model publication period
This fixes the extraction of bit fields from model publication
period octet received as part of Congif Publication Set message.

The step resolution field is extracted as upper 2 bits (shift by 6)
and the number of steps field is extracted by masking lower 6 bits.
2020-07-29 11:58:50 -07:00
Brian Gix
81cba0be7e mesh: Add guard against wedging outbound queue
When using HCI command chains, the first packet send that starts an
outbound sequence needs to still exist when command chain completes, or
the outbound queue will wedge.  The simplest solution is to send packets
at least twice on an empty queue, if there is a chance it could be canceled.
2020-07-29 11:58:49 -07:00
Inga Stotland
81a0868b08 mesh: Move model functionality out of node.c to model.c
This moves the model related code out of node.c to model.c providing
for better functional separation of modules.

Also, use the value of 0xFFFF for internal representation of vendor ID
for BT SIG defined models. This allows to maintain a single internal
vendor ID / model ID space.
2020-07-25 14:36:04 -07:00
Brian Gix
e9db825e99 mesh: Fix memory leak on provisioning timeout
If the Provision Acceptor times out without completing successfully, the
timer it was using was never freed.
2020-07-23 11:58:58 -07:00
Inga Stotland
1d1577c929 mesh: Add size checks for every opcode in config server
This adds missing size checks for the incoming config server messages.
2020-07-16 10:11:59 -07:00
Inga Stotland
ab9dd9102d mesh: Use static array to hold config server response
This eliminates dynamic allocation for long responses and local
arrays for short responses. Instead, aclear text response from
config server is written into a static buffer and then encoded
into dynamically allocated messafe buffer to use in actual
transmission.
2020-07-16 10:10:52 -07:00
Brian Gix
192fb06798 mesh: Fix node composition change detection
This fixes a bug that caused disallowed composition changes from being
detected and rejected. The only fields that are allowed to freely change
are CID, PID, VID and CRPL.
2020-07-16 09:58:30 -07:00
Inga Stotland
7e42aa7a37 mesh: Get rid of "unreliable opcodes" in config server
This removes an old notion of unreliable opcodes in config server
model , i.e., a correctly formatted acknowledged message always
gets a response.
2020-07-08 10:55:11 -07:00
Brian Gix
014418caa1 mesh: Add Composition page storage to node.json
Mesh supports multiple Composition Pages, although only one is defined
in the current specification. This change allows saving and retrieval of
any pages, numbered 0-255.
2020-07-08 10:55:11 -07:00
Brian Gix
bce4501612 mesh: Fix Seg Fault - App unattached IVIndex chg
Object path to node interfaces do not exist unless the owning
application is attached.  This caused a Segmentation fault if IVIndex
change was signaled.

Crash output:

mesh/pb-adv.c:send_adv_segs() size: 01, CRC: 3e
mesh/pb-adv.c:pb_adv_packet() Link closed notification: 00
mesh/net.c:update_iv_ivu_state() iv_upd_state = IV_UPD_NORMAL

Program received signal SIGSEGV, Segmentation fault.
0xb6fbc1dc in strlen () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so
(gdb) backtrace
0  0xb6fbc1dc in strlen () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so
1  0x00448488 in l_str_hash (p=0x0) at ell/hashmap.c:168
2  0x00448980 in l_hashmap_lookup (hashmap=0x46b550, key=key@entry=0x0) at ell/hashmap.c:487
3  0x00444704 in _dbus_object_tree_property_changed (dbus=0x469438, path=0x0, interface_name=0x44bb74 "org.bluez.mesh.Node1", property_name=0x44aa18 "IVIndex") at ell/dbus-service.c:1196
4  0x0044545c in l_dbus_property_changed (dbus=<optimized out>, path=<optimized out>, interface=<optimized out>, property=<optimized out>) at ell/dbus-service.c:1804
5  0x0041805c in node_property_changed (node=<optimized out>, property=<optimized out>) at mesh/node.c:2392
6  0x0040c690 in update_iv_ivu_state (ivu=false, iv_index=0, net=0x46e240) at mesh/net.c:2569
7  process_beacon (net_ptr=0x46e240, user_data=0xbefff1e4) at mesh/net.c:2610
8  0x00431edc in l_queue_foreach (queue=<optimized out>, function=0x40c468 <process_beacon>, user_data=user_data@entry=0xbefff1e4) at ell/queue.c:441
9  0x0040a848 in beacon_recv (user_data=<optimized out>, info=<optimized out>, data=<optimized out>, len=<optimized out>) at mesh/net.c:2647
10 0x00431edc in l_queue_foreach (queue=<optimized out>, function=0x408bec <process_rx_callbacks>, function@entry=0x15463acd, user_data=user_data@entry=0xbefff230) at ell/queue.c:441
11 0x00409ec0 in process_rx (len=<optimized out>, data=0xbefff297 "+\001", addr=0xbefff258 "\260\362B", instant=4646248, rssi=-78 '\262', pvt=<optimized out>) at mesh/mesh-io-generic.c:121
12 event_adv_report (io=0x46c3c8, size=<optimized out>, buf=0xbefff255) at mesh/mesh-io-generic.c:159
13 event_callback (buf=<optimized out>, size=<optimized out>, user_data=0x46c3c8) at mesh/mesh-io- generic.c:172
14 0x0042ff58 in queue_foreach (queue=0x46d370, function=0x42f2b0 <process_notify>, user_data=user_data@entry= 0xbefff289) at src/shared/queue.c:219
15 0x0042f674 in process_event (size=<optimized out>, data=0xbefff283, hci=0x46c3d8) at src/shared/hci.c:258
16 io_read_callback (io=<optimized out>, user_data=0x46c3d8) at src/shared/hci.c:286
17 0x00432600 in io_callback (fd=<optimized out>, events=1, user_data=0x46d318) at ell/io.c:126
18 0x0043348c in l_main_iterate (timeout=<optimized out>) at ell/main.c:470
19 0x00433554 in l_main_run () at ell/main.c:520
20 l_main_run () at ell/main.c:502
21 0x004337b4 in l_main_run_with_signal (callback=<optimized out>, user_data=0x0) at ell/main.c:642
22 0x00404e90 in main (argc=<optimized out>, argv=<optimized out>) at mesh/main.c:269
(gdb)
2020-07-03 10:01:37 -07:00
Inga Stotland
e803b54864 mesh: Check app model settings of pub/sub support
This adds handling of new options dictionary included with
"Models" and "VendorModels" properties on org.bluez.mesh.Element1
interface.

Supported (optional) dictionary entries:
"Publish" - indicates whether the model supports publication mechanism.
                If not present, publication is enabled.
"Subscribe" - indicates whether the model supports subscription mechanism.
                If not present, subscriptions are enabled.

If a config message related to subscription state is received for a model
that does not support subscription mechanism, an error code 0x08,
("Not A Subscribe Model") is sent in response.

If a config message related to publication state is received for a model
that does not support publication mechanism, an error code 0x07
("Invalid Publish Parameters") is sent in response.
2020-07-01 12:06:07 -07:00
Inga Stotland
96c140c2c4 mesh: Clean up config model publication set
No functioal changes. Make code more readable, plus style fixes.
2020-06-30 10:14:09 -07:00
Brian Gix
b7992c3cd5 mesh: Fix memory leak when queuing OB pkts rapidly
If a new packet for outbound delivery is queued during the last
transmission of the only other packet being sent, the prior
packet got forgotten and leaked. This fix correctly deletes the prior
packet, but also makes sure it is given the proper oportunity for
transmission.
2020-06-22 14:36:55 -07:00
Inga Stotland
af07ca6950 mesh: Emit PropertiesChanged when IV Index changes
This adds emitting of PropertiesChanged signal whenever the
mesh IV index is updated to indicate that the vlaues of "IvIndex"
property has been modified.
2020-06-22 14:36:55 -07:00
Michał Lowas-Rzechonek
c341002952 mesh: Replace BeaconFlags with just IvUpdate
To import nodes, applications need just IvIndex and IvUpdate. KeyRefresh
phase in under provisioner's control, so we don't need to expose it.

Moreover, BeaconFlags property dealt just with the primary net key, and
each subnet key is refreshed separately.
2020-06-18 08:34:14 -07:00
Brian Gix
fd35323543 mesh: Add deferral of Attach() and Leave() if busy
We require the successful return of JoinComplete() method before
handling subsequent Attach() or Leave() method calls. To simplify the
construction of Applications, we will accept one of these calls up to 1
second prior to receiving the final return status of JoinComplete,
which tells us that the Application is ready to use the node.

If the node is still not ready after the deferral, Attach and/or Leave
will fail.
2020-06-18 08:34:14 -07:00
Michał Lowas-Rzechonek
4527a8ad82 mesh: Rename IVUpdate import flag to IvUpdate
Name change for consistency with "IvIndex" property.
2020-06-16 10:39:22 -07:00
Inga Stotland
d4989cb19d mesh: Delete unused structures/functions
This deletes unused functions and structures in net.c & net.h.
Plus, some style cleanup.
2020-06-16 10:39:22 -07:00
Michał Lowas-Rzechonek
f34b7e0ba8 mesh: Fix updating CID, PID, VID & CRPL on node attach
In 8a38226212, we wanted to allow the
application to update certain composition fields. This patch makes it
work.
2020-06-15 12:53:45 -07:00
Inga Stotland
7bcb1086ab mesh: Add "node is busy" check for Leave() & Attach()
This introduces the following behavior change for those methods
on Network interface that specify node token as an input parameter

Leave() method:
If Leave method is called for a node that is being processed as a result
of a Create, Import, Join or Attach method calls in progress, node removal
is not allowed and org.bluez.mesh.Error.Busy error is returned.

Attach() method:
If Attach method is called for a node that is being processed as a result
of a Create, Import or Join method calls in progress, node attachment
is not allowed and org.bluez.mesh.Error.Busy error is returned.
2020-06-10 10:27:17 -07:00
Inga Stotland
4de95f9fbe mesh: Add timeout to GetManagedObjects call
Switch to using dbus_send_with_timeout when making a request
to get managed objects from an application.
2020-06-10 10:27:17 -07:00
Inga Stotland
65cdf6b22c mesh: Add destroy callback to dbus_send_with_timeout()
This adds a destroy callback as a function parameter to
dbus_send_with_timeout() to allow automatic release of user data
on either reply or timeout.
2020-06-10 10:27:17 -07:00
Inga Stotland
e5179f9fe5 mesh: Make "Busy" and "InProgress" to be distinct errors
This separates "Busy" and "InProgress" error codes:
MESH_ERROR_IN_PROGRESS maps to org.bluez.mesh.Error.InProgress
MESH_ERROR_BUSY maps to org.bluez.mesh.Error.Busy

Minor API change:
UpdateAppKey() returns "InProgress" error instead of "Busy"
2020-06-10 10:27:17 -07:00
Inga Stotland
29ab37c76a mesh: Delete unused function
This deletes unused function node_is_provisioned()
2020-06-10 10:27:16 -07:00
Brian Gix
4cf36cb549 mesh: Fix clean-up introduced bug
Before the clean-up we were making a useless check of an otherwise
unused boolean (net->provisioner) to determine if we should decode with
device keys (which was incorrect). This was replaced by a check the
node type (node->provisioner). However, the check was incorrect in the
first place, and prevents provisioner nodes from decrypting non device
key messages.
2020-06-08 16:14:36 -07:00
Inga Stotland
bae266797b mesh: Remove unused/redundant functions
This removes mesh_net_provisioner_mode_set (unused) and
mesh_net_provisioner_mode_get (duplicates node_is_provisioner)
2020-06-08 13:30:50 -07:00
Michał Lowas-Rzechonek
d565cc8dda mesh: Fix FPE in overcommit logic.
During overcommit, mesh_config_save is called in asynchronous mode to
avoid blocking Send() calls. This means that update of cfg->write_time
is scheduled via l_idle_oneshot, so if the next Send() gets scheduled
first, the code may see elapsed time of zero.

If this happens, then the overcommit logic was already executed and the
overcommit is pending, so we can just return.
2020-06-02 09:08:33 -07:00
Inga Stotland
ad37211780 mesh: Remove unused functions from net.c
The folllowing functionsa are not being used anywhere in the code and
have been removed:
mesh_net_flush()
mesh_net_prov_caps_get()
mesh_net_priv_key_get()
mesh_net_priv_key_set()
mesh_net_prov_rand()
mesh_net_prov_uni()
mesh_net_id_uuid_set()
mesh_net_test_addr()
mesh_net_test_mode()
mesh_net_uni_range_set()
mesh_net_uni_range_get()
mesh_net_set_window_accuracy()
2020-06-01 10:23:11 -07:00
Inga Stotland
962a759e9d mesh: Clean up style in net.c 2020-06-01 10:23:11 -07:00
Inga Stotland
c0013ccdb1 mesh: Remove debug-only related callback for packet send
This removes callback for sending every single access layer packet
since the callback does nothing but print debug satement. This
functionality is mature enough not to require such heavy debugging.
2020-06-01 10:23:10 -07:00
Inga Stotland
cb3088b598 mesh: Debug output clean up
This changes l_info() to l_debug() for recurring cases and
removes some excessive debug output.
2020-06-01 10:23:10 -07:00
Inga Stotland
c0509b127a mesh: Helper packet print should depend on debug setting
This changes the utility function print_packet() to check if
daemon is running in debug mode.
2020-06-01 10:23:10 -07:00
Brian Gix
ba4289c72e mesh: Destroy PB-ADV queue when provisioning done 2020-05-22 14:07:52 -07:00
Brian Gix
c80f88bdff mesh: Fix leaked message reference 2020-05-22 13:54:39 -07:00
Brian Gix
9084172128 mesh: Fix leaked mesh_net allocation 2020-05-22 13:54:39 -07:00
Brian Gix
29d737730a mesh: Fix using uninitialized bytes
Fixes two problems found with static analysis
2020-05-22 13:54:39 -07:00
Inga Stotland
ebed46f05e mesh: Clean up Join() method
This consolidates various places where a pending response
to Join() is created and makes sure that l_dus_message_unref()
is called correctly.
2020-05-22 13:45:53 -07:00
Inga Stotland
9dd9cba0a2 mesh: Fix memory leak in Create, Import & Attach methods
This ensures that every time l_dbus_message_ref() is used to preserve
a message for a pending method reply, there is a matching call to
l_dbus_message_unref().
2020-05-22 13:45:53 -07:00
Inga Stotland
7a5007178f mesh: Clean up Attach() method call
This consolidates error return form one place: off a callback
with unsuccessful status.
2020-05-22 13:45:53 -07:00
Inga Stotland
1b7d879555 mesh: Clean up Import() method call
This removes unnecessary failing conditions in Import() call and
simplifies iterations through "flags" dictionary.
2020-05-22 13:45:53 -07:00
Inga Stotland
dedc3cb274 mesh: Create a queue of pending requests in mesh_init()
This removes unnnecessary checking for queue existence every time
either Attach(), Create() or Import() methods are called.
2020-05-22 13:45:53 -07:00
Inga Stotland
b0adb615ca mesh: Remove unused function prototypes from node.h 2020-05-22 13:45:53 -07:00
Inga Stotland
7cdc215ff5 mesh: Add finalization of a newly created node
When a new node is created as a result of successful completion
of either Join() or Create() or Import() methods and has been
confirmed via successful token delivery to the application,
clean up node's D-Bus resources (application path, element paths, etc)
that have been gathered during the initial GetMAnagedObjects() call.
Also, remove the agent instance associaed with the new node.

These resources will be re-populated after the Attach() call
verifies the node's integrity.
2020-05-22 13:45:52 -07:00
Inga Stotland
7eca3becce mesh: Remove agent when freeing node's dynamic resources
This adds clean up of node's agent instance when node's dynamic
resources are freed.
2020-05-22 13:45:52 -07:00
Inga Stotland
f5fcab3276 mesh: Free allocated agent in mesh_remove_agent()
This adds previously missing call to free memory allocated
for agent structure.
2020-05-22 13:45:52 -07:00
Inga Stotland
8afaf5e958 mesh: Remove unused structure member
This removes unused "agent" member from join_data structure.
2020-05-22 13:45:52 -07:00
Brian Gix
0e8ed1f261 mesh: Fix double-free
This fixes a double-free error when destroying the NVM storage of a mesh node.
Cleanly handle two distinct scenarios:

1. When the node is being deleted at runtime.  This causes release of
   both dynamic memory and NVM storage.

2. During shutdown, we release dynamic memory only.
2020-05-20 15:16:55 -07:00
Inga Stotland
2cd067b8b7 mesh: Fix segfault caused by re-enabling of HCI controller
This fixes the crash that occurs when a controller used by bluetooth-meshd
is removed and then added back again.

Also, correctly restart scanning when the controller is re-enabled.

Backtrace:
0x00005618e754d040 in ?? ()
0x00005618e6e12d9a in io_ready_callback () at mesh/mesh.c:174
0x00005618e6e3d2c8 in l_queue_foreach () at ell/queue.c:441
0x00005618e6e37927 in request_complete () at src/shared/mgmt.c:261
2020-05-17 08:12:20 -07:00
Brian Gix
d18cb97bb5 mesh: Fix valgrind memory leak warnings
These warnings are caused by not completely freeing memory allocations
at shutdown, and are not serious, but they make valgrind output cleaner.
2020-05-15 18:25:30 -07:00
Brian Gix
cc0719ceae mesh: Fix valgrind memory leaks
These memory leaks are ones that will compound over time with node
creation and deletion.
2020-05-15 18:24:18 -07:00
Inga Stotland
a51871bd73 mesh: Remove redundant call to save node configuration
This removes a redundant call to save node configuration in
add_local_node(): there is a number of unconditional calls to
mesh_config_write_<some_node_Setting>() within this function
which would result in the node configuration being saved implicitly.
2020-05-14 09:12:56 -07:00
Inga Stotland
8a38226212 mesh: Allow updating CID, PID, VID & CRPL on node attach
This allows to update settings of the following composition fields
when an existing node (application) attaches to the daemon:
Company ID (CID), Product ID (PID), Versioin ID (VID),
CRPL (replay protection depth)
2020-05-14 09:12:56 -07:00
Inga Stotland
b91f6f0be3 mesh: Avoid saving duplicate fields in node config
This modifies miscellaneous utility functions in mesh-config-json.c:
when writing a new value to a node configuration file, delete
the existing field containing an old value first.
2020-05-14 09:12:56 -07:00
Inga Stotland
82b2d4cf5e mesh: On node attach, verify element/model composition only
When attaching an existing node, verify only the "elements" part
of device composition, i.e., skip verification of CID/PID/VID, CRPL
and features.
2020-05-09 06:45:28 -07:00
Inga Stotland
48cef391a4 mesh: Fix publication setup for vendor models
This fixes model ID generation when processing Config Pub Set
message. Also, cleanup some debug prints.
2020-04-30 10:09:05 -07:00
Inga Stotland
cbad3121d5 mesh: Fix adding virtual subscription to a vendor model
This fixes a case when a configuration server receives a virtual
subscription add/overwrite command targeting a vendor model.
Correctly set "vendor" argument before trying to save the updated
subscrition to configuration file.
2020-04-30 10:09:05 -07:00
Brian Gix
ef0970a723 mesh: Fix GCC 10.0 warnings 2020-04-18 08:21:03 -07:00
Brian Gix
8a73c868b7 mesh: Add Time-outs to critical dbus send-with-replies
JoinComplete() dbus method calls are the only time that node tokens are
delivered to client Applications, so if the call fails for any reason
(including time-outs) the daemon has a way to clean-up the stale unused
node data.
2020-04-14 08:45:47 -07:00
Przemysław Fierek
a4ead01159 mesh: Change API to deliver tokens via JoinComplete
This patch changes Import and CreateNetwork API to deliver tokens via
the JoinComplete method call.  When application doesn't raise any error
during handling JoinComplete then it is assumed that the token has been
saved, otherwise when application replies with an error message then the
node is removed.
2020-04-14 08:45:47 -07:00
Przemysław Fierek
d5cc4ffd55 mesh: Fix invalid app_path on 'Join'
This patch fixes invalid app_path on 'Join' method call - the daemon
tried to use the value of app_root API argument, while it should use
path discovered by scanning result of GetManagedObjects() call.
2020-04-10 06:06:30 -07:00
Rafał Gajda
60423fed39 mesh: Ignore beacons with IVU if IV already updated
When daemon receives beacon with IV=n+1, IVU=False it will
start sending messages with new IV and set sequence to 0.
However if daemon receives another beacon with IV=n+1, IVU=True it
will go back to sending messages with old IV=n (IVU set to True).
Because sequence number has been reset those messages will be dropped
by replay protection and node will lose communication.

Once IV is updated daemon should not go back to using the old value.

This patch adds beacon rejection if IV has already been updated.
2020-04-08 10:08:31 -07:00
Michał Lowas-Rzechonek
59aae8b1cc mesh: Remove redundant code from mesh/crypto
- Remove application_encrypt/application_decrypt
- Make mesh_crypto_privacy_counter private, add mesh_crypto_pecb
- Make *_nonce functions private and align their implementation to be
  more consistent
- Refactor network_encrypt/network_decrypt to use *_nonce functions and
  rename them to packet_encrypt/packet_decrypt
- Refactor packet_encode/packet_decode
2020-04-07 09:52:44 -07:00
Inga Stotland
55d06e0cd5 mesh: Fix segfault related to idle config write
If node configuration is completely removed from the system,
remove all pending writes to the configuration file.

Fixes the segfault below:

mesh/cfgmod-server.c:node_reset() Node Reset
mesh/mesh-config-json.c:mesh_config_destroy() Delete node config /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/rpl/00000000/0001
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/rpl/00000000
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/rpl
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/node.json.bak
mesh/util.c:del_fobject() RM /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c/node.json
mesh/util.c:del_fobject() RMDIR /var/lib/bluetooth/mesh/02040d0a060e0a08090b0103070f050c
Segmentation fault

Program terminated with signal SIGSEGV, Segmentation fault.

  0x0000563a35df2ed0 in ?? ()
  0x00007fd6b131689f in json_object_to_json_string_length (jso=jso@entry=0x563a35dd8d30, flags=flags@entry=2,
2020-04-01 18:27:14 -07:00
Inga Stotland
4e42f2edde mesh: Move SEQ_MASK define in mesh-defs.h 2020-04-01 18:27:14 -07:00
Brian Gix
3eaf2f114d mesh: Clear prov capabilities structure before reading
Capabilities need to be zero'd before realtime reading fresh values,
because they are mostly bitmasks, which are set when capabilities are
detected, and never otherwise cleared.
2020-04-01 12:06:15 -07:00
Michał Lowas-Rzechonek
1695ec1e0c mesh: Honor provisioner's capabilities
This patch makes the daemon select authentication method based from
capabilities supported by both provisioned node and provisioner
application.
2020-04-01 12:06:14 -07:00
Michał Lowas-Rzechonek
f333ce2d95 mesh: Refresh provisioner's capabilities
As provisioner's capabilities might change during application lifetime
(e.g. no network link to download OOB key), let's query the agent again
after application calls AddNode().
2020-04-01 12:06:14 -07:00
Michał Lowas-Rzechonek
037d452415 mesh: Clean up naming of provisioning callbacks 2020-04-01 12:06:14 -07:00
Michał Lowas-Rzechonek
4b2d782fb6 mesh: Remove unused 'server' argument 2020-04-01 12:06:14 -07:00
Przemysław Fierek
84a9b6ce4b mesh: Add net key index to sar structure
This patch adds net key index to struct mesh_sar. This fixes problem with
using invalid network key to encrypt application messages.
2020-03-31 16:27:56 -07:00
Przemysław Fierek
c55b358d01 mesh: Remove unused functions: 'mesh_net_sub_list_add' and 'mesh_net_sub_list_del' 2020-03-31 10:20:04 -07:00
Przemysław Fierek
1813d813c9 mesh: Remove unused argument from 'mesh_net_transport_send' function 2020-03-31 10:18:57 -07:00
Inga Stotland
4100dede01 mesh: Update UnprovisionedScan, AddNode & ScanResult
The following methods are modified to allow for future development:

Interface org.bluez.mesh.Management1:

Old: void UnprovisionedScan(uint16 seconds)
New: void UnprovisionedScan(dict options)

    The options parameter is a dictionary with the following keys defined:
    uint16 Seconds
                Specifies number of seconds for scanning to be active.
                If set to 0 or if this key is not present, then the
                scanning will continue until UnprovisionedScanCancel()
                or AddNode() methods are called.
    other keys TBD

Old: void AddNode(array{byte}[16] uuid)
New: void AddNode(array{byte}[16] uuid, dict options)

    The options parameter is currently an empty dictionary

Interface org.bluez.mesh.Provisioner1

Old: void ScanResult(int16 rssi, array{byte} data)
New: void ScanResult(int16 rssi, array{byte} data, dict options)

    The options parameter is currently an empty dictionary
2020-03-30 15:03:56 -07:00
Michał Lowas-Rzechonek
5379e024fc mesh: Fix model publication status after set
This patch fixes usage of send_pub_status() when handling publication
set message - mod_id was swapped with pub_addr, resulting in malformed
message being sent back to the Config Client.
2020-03-26 10:00:33 -07:00
Prathyusha N
424f88e7b8 mesh: Handle close for Acceptor
Provision complete callback is handled in provision failure case.
If link closed received abruptly with reason success, triggered
provision complete callback. Removed session timeout and session
free as they are handled in pb_adv_unreg.
2020-03-25 10:31:14 -07:00
Brian Gix
936122a230 mesh: Whitespace correction 2020-03-25 09:55:49 -07:00
Prathyusha N
ac940a70ce mesh: Send input complete for input OOB Authentication
Send input complete when user completes input operation.
2020-03-25 09:50:05 -07:00
Prathyusha N
8ef71fca7f mesh: Handle invalid public keys
Check for invalid public keys received and send provision failed.
2020-03-25 09:43:50 -07:00
Prathyusha N
9b4d8f1dc1 mesh: Handle netkey delete when netkey is not in netkeylist
4.4.1.2.9 of Mesh Profile Bluetooth specification:
When an element receives a Config NetKey Delete message that
identifies a NetKey that is not in the NetKey List, it
responds with Success, because the result of deleting the
key that does not exist in the NetKey List will be the same
as if the key was deleted from the NetKey List.
2020-03-25 09:42:30 -07:00
Brian Gix
97e24f9182 mesh: Fix Replay Protection Cache
There was a bug identified in the RPL storage, such that the real-time
queue was being filled by incorrect unicast addresses. (Thx ccsanden).
2020-03-23 14:37:04 -07:00
Brian Gix
e8c870c63b mesh: Allow short messages to be segmented
For added reliability, it is legal to send short messages as "single
segment" segmented messages, which require transport layer
acknowledgement. This feature is intended for heavy usage in the future
so I am adding it now.

Further, to support this functionality, an additional queue has been
added to allow multiple SAR messages to the same DST to be queued and
sent serially.
2020-03-20 11:51:18 -07:00
Inga Stotland
5885eab5bd mesh: Fix processing of Config Node Reset message
This fixes a condition when a node continues processing messages
after it has been reset by a remote configuration client.
Upon receiving Config Node Reset message, node removal happens after
a grace interval to allow sending of Config Node Reset Status reply.
2020-03-18 09:20:28 -07:00
Inga Stotland
ff41bce83d mesh: Remove unused parameters from internal rx functions
This removes unused ttl parameter from mesh_model_rx(). The TTL value
is not processed at the access layer, so there is no need to pass it
to a model.
Also, remove "uint32_t dst" parameter from the typedef of
mesh_model_recv_cb: providing a just destination address is sufficient
for internally implemented models (currently, it's only Config Server)
2020-03-05 08:01:28 -08:00
Inga Stotland
818a59aead mesh: Clean up handling config model publication message
This tightens up the Config Server code that handles the processing of
Config Model Publication Set and Config Model Publication Get messages.
2020-02-26 11:20:08 -08:00
Inga Stotland
754b2c387b mesh: Simplify model virtual pub/sub logic
This reorganizes the part of the code that handles model publishing
and subscribitng to virtual labels.
2020-02-26 11:20:08 -08:00
Brian Gix
6a6fe856a9 mesh: rework incoming advertisement filtering
Future versions of Mesh will introduce new advertising packets, which
do not fit in the limited and rigid filtering currently used. This minor
rewrite allows registering and receiving of *any* AD types, including
the filtering on multiple octets of the incoming AD parts.
2020-02-26 11:20:08 -08:00
Inga Stotland
17516034a6 mesh: Fix app payload decryption for virtual labels
This fixes a bug when a virtual label and its size hasn't been passed
to a decryption function: instead of always using NULL pointer for
label and 0 for lable size, use actual virtual label info if decrypting
a payload addressed to a virtual destination.
2020-02-18 15:55:30 -08:00
Inga Stotland
8e100bb8be mesh: Fix keyring app keys directory iteration
This fixes how app key files are accessed when finalizing
Key Refresh procedure. Instead of using open(entry->d_name, ...)
to get file descriptor, use openat(dir_fd, entry->d_name, ...)
since entry->d_name contains a relative app key filename, not an
absolute path.
2020-02-07 09:22:47 -08:00
Inga Stotland
fb811a090b mesh: Allow to finish key refresh when no AppKeys are stored
This handles a case when a Key Refresh procedure is in place with
no application keys stored in the keyring. When KR procedure is
finalized, the check for the presence of AppKeys storage directory
does not return failure if the directory does not exist.

Also, remove duplicate include.
2020-02-07 09:19:14 -08:00
Jakub Witowski
2f9ec7f887 mesh: remove unused node_set_device_key()
This patch removes node_set_device_key() function,
because it is unused.
2020-01-31 10:22:16 -08:00
Jakub Witowski
845541f052 mesh: use static node_comp instead of the pointer
There is no need to use the pointer to the node_comp data.
This pach uses static node_comp instead.
2020-01-31 10:22:16 -08:00
Brian Gix
da429de905 mesh: Re-arrange replay protection check and add
Re-arranged for efficiency. Replay Protection was set up as an atomic
check-and-add operation. Now we check the message early so we can
discard it without taking further action, and only add it to the RPL
once fully verified that it was authorized and addressed to us.
2020-01-31 10:15:08 -08:00
Brian Gix
8457e6a3ad mesh: Add NVM storage of Replay Protection
Mesh specification requires that Replay Protection be preserved
across node restarts.  This adds that storage in
<node_uuid>/rpl/<iv_index>/<src>

Realtime access remains in an l_queue structure, and stored as
messages are processed.
2020-01-30 11:03:47 -08:00
Brian Gix
17e97efc3f mesh: Apply Replay Protection to all incoming packets
Replay Protection was only being applied against Application Keys,
but messages with Device Keys are just as vulnerable, and need to be
checked as well.
2020-01-30 11:03:47 -08:00
Brian Gix
162bda4899 mesh: Clean-up unneeded Sequence Number increments
Scrub of Sequence Number handling of OB messages to account for in-node
delivery of segmented messages, so that each discrete message has a
unique sequence number for the RPL.
2020-01-30 11:03:47 -08:00
Brian Gix
243a46b6ca mesh: Move Replay Protection to mesh/net.c
The specification calls for a flatter Replay Protection List that
applies to all processed messages, regardless of which credentials
were used to secure them. So storage and checking is now centralized
in mesh/net.c
2020-01-30 11:03:47 -08:00
Brian Gix
525d1ec340 mesh: Relocate tree deletion to util.c/h 2020-01-30 11:03:47 -08:00
Prathyusha N
87137b1d1a mesh: Handle publickey exchange phase for initiator
In Public Key OOB case, when provisioner receives public key via
OOB, provisioner has to send it's public key to remote node and
and then proceed for authentication.

Handle invalid keys case.
2020-01-25 08:25:37 -08:00
Shaunak Soman
b8af883daf mesh: Fix provisioning agent method call failure
Provisioning agent interface methods PublicKey, PrivateKey and
Cancel do not accept any parameters. So, while invoking them
explicitly set the parameters to "".
2020-01-23 07:38:23 -08:00
Brian Gix
c0b61227ac mesh: Offload loopback packets to l_idle_onshot()
Any packet that may be handled internally by the daemon must be sent in
it's own idle_oneshot context, to prevent multiple nodes from handling
and responding in the same context, eventually corrupting memory.

This addresses the following crash:
Program terminated with signal SIGSEGV, Segmentation fault.
 0  tcache_get (tc_idx=0) at malloc.c:2951
     2951   tcache->entries[tc_idx] = e->next;
(gdb) bt
 0  tcache_get (tc_idx=0) at malloc.c:2951
 1  __GI___libc_malloc (bytes=bytes@entry=16) at malloc.c:3058
 2  0x0000564cff9bc1de in l_malloc (size=size@entry=16) at ell/util.c:62
 3  0x0000564cff9bd46b in l_queue_push_tail (queue=0x564d000c9710, data=data@entry=0x564d000d0d60) at ell/queue.c:136
 4  0x0000564cff9beabd in idle_add (callback=callback@entry=0x564cff9be4e0 <oneshot_callback>, user_data=user_data@entry=0x564d000d4700,
    flags=flags@entry=268435456, destroy=destroy@entry=0x564cff9be4c0 <idle_destroy>) at ell/main.c:292
 5  0x0000564cff9be5f7 in l_idle_oneshot (callback=callback@entry=0x564cff998bc0 <tx_worker>, user_data=user_data@entry=0x564d000d83f0,
    destroy=destroy@entry=0x0) at ell/idle.c:144
 6  0x0000564cff998326 in send_tx (io=<optimized out>, info=0x7ffd035503f4, data=<optimized out>, len=<optimized out>)
    at mesh/mesh-io-generic.c:637
 7  0x0000564cff99675a in send_network_beacon (key=0x564d000cfee0) at mesh/net-keys.c:355
 8  snb_timeout (timeout=0x564d000dd730, user_data=0x564d000cfee0) at mesh/net-keys.c:364
 9  0x0000564cff9bdca2 in timeout_callback (fd=<optimized out>, events=<optimized out>, user_data=0x564d000dd730) at ell/timeout.c:81
 10 timeout_callback (fd=<optimized out>, events=<optimized out>, user_data=0x564d000dd730) at ell/timeout.c:70
 11 0x0000564cff9bedcd in l_main_iterate (timeout=<optimized out>) at ell/main.c:473
 12 0x0000564cff9bee7c in l_main_run () at ell/main.c:520
 13 l_main_run () at ell/main.c:502
 14 0x0000564cff9bf08c in l_main_run_with_signal (callback=<optimized out>, user_data=0x0) at ell/main.c:642
 15 0x0000564cff994b64 in main (argc=<optimized out>, argv=0x7ffd03550668) at mesh/main.c:268
2020-01-17 23:06:57 -08:00
Inga Stotland
7af962a04a mesh: Fix opcode for OP_VEND_MODEL_APP_GET
This changes the value of OP_VEND_MODEL_APP_GET to 0x804D (it was
incorrectly set to 0x804C)
2020-01-17 23:06:57 -08:00
Jakub Witowski
6a889a28f1 mesh: Sequence number related fixes 2020-01-16 08:45:31 -08:00
Michał Lowas-Rzechonek
b31eee8907 mesh: Rename --index to --io, support additional io types.
This allows specifying io type and options when invoking the daemon.

When no "-i" is passed, meshd still runs with MESH_IO_TYPE_GENERIC and
tries to attach to the first available HCI interface.

Options "-i <n>" and "-i hci<n>" are just shortcuts for
"--io=generic:<n>" and "--io=generic:hci<n>", respectively.
2020-01-16 08:45:31 -08:00
Jakub Witowski
c281c3cd90 mesh: Add sequence nr getter code 2020-01-14 10:55:54 -08:00
Inga Stotland
6fe78e8746 mesh: Correctly generate NetKey list
When responding with NetKey List Status, packed NetKey indices into
3 octets per pair. If number of NetKeys is odd, append the last key
index as a 2-octet value.
2020-01-14 06:32:23 -08:00
Michał Lowas-Rzechonek
559410f33a mesh: Fix exiting IV_UPD_STATE when receiving first SNB
First valid SNB received from the network should cause the node to
switch into IV_UPD_NORMAL state.

Otherwise, it will never try to enter IV Update procedure when sequence
number approaches the IV_UPDATE_SEQ_TRIGGER, because that's only allowed
in IV_UPD_NORMAL.
2020-01-14 06:32:23 -08:00
Michał Lowas-Rzechonek
038b0b11e1 mesh: Allow apps to receive DevKey messages from external nodes
After introducing "remote" flag for DevKeyMessageReceived in
c8cd5b04cc, we can now allow applications
to received DevKey messages from external addresses as well as from
local ones.

This enables applications to properly implement models using DevKey
security, by accepting only requests with "remote" flag set to false.
2020-01-14 06:32:23 -08:00
Inga Stotland
e2b6608934 mesh: Fix wholesale deletion of appkeys bound to a netkey
When a netkey is deleted all the appkeys bound to this key has
to be deleted as well. This fixes app_key queue manipulation to
avoid issues caused by modifying the queue while iterating over it:
instead of iteration over all the entries, find a first bound key,
delete it, find next... and so on, until there are no bound keys
left in the app_keys queue.
2020-01-14 06:32:23 -08:00
Inga Stotland
6baade2306 mesh: Fix logic in AppKey deletion
When deleting an AppKey from a node, call mesh_config_app_key_del()
only from appkey level (i.e., keep it contained in appkey.c and
remove the duplicate call in node.c)

Also, simplify the node_app_key_delete() argument list.
2020-01-14 06:32:23 -08:00
Brian Gix
ad7db1fa1f mesh: Implement provisioning loop-back
This allows one App using the mesh daemon to provision another.
2020-01-13 09:15:15 -08:00
Michał Lowas-Rzechonek
f314075531 mesh: Fix BeaconFlags property type
This property is an uint8, not a boolean.
2020-01-08 14:02:36 -08:00
Rafał Gajda
a7ba7ae31a mesh: Remove local_iv_index and local_ivu aliases 2020-01-08 13:55:21 -08:00
Rafał Gajda
d3093475b5 mesh: Fix IV recovery
This patch fixes saving IV received in SNB to storage.

Previously after creating new node with IV 0 (or loading node with
IV > 0 but after long inactivity) first received SNB should update IV
(and reset sequence number to 0 if necessary).

The bug would prevent new IV being saved in storage which resulted in
sequence number being set to 0 on first SNB received after every daemon
reset but IV never being updated.
2020-01-08 13:55:21 -08:00
Michał Lowas-Rzechonek
1169eb4434 mesh: Remove misleading DEFAULT_CRPL from node.c 2020-01-08 09:07:15 -08:00
Michał Lowas-Rzechonek
7ff2bb9efe mesh: Fix node reset
Instead of stopping the daemon, just remove the node.
2020-01-08 09:07:15 -08:00
Inga Stotland
59d5f21e6c mesh: Style fix
This fixes style issues: spaces -> tabs, alignment.
2020-01-06 07:29:34 -08:00
Prathyusha N
99fa144721 mesh: Start link establishment timer of 60 sec
5.3.2 of Mesh Profile Bluetooth specification:
To open a link, the provisioner shall start the link establishment
timer, set to 60 seconds, and then shall start sending Link Open
messages.

On timeout, close indication will be sent. Provisioner cancels the
Link Establishment timer, when the link is open i.e. in pb_adv_tx().
2019-12-27 08:55:25 -08:00
Inga Stotland
11d7fe8535 mesh: Base config json code on newer version of json-c
This removes a roundabout logic that was required to delete
a json entry from a json array using libjsonc utilities.
A new API function, json_object_array_del_idx(), implemented in
json-c version 0.13 simplifies array entry removal to one call.

Also, add requirement to configure.ac for json-c version >= 0.13
2019-12-24 10:38:34 -08:00
Brian Gix
ffdd4f5817 mesh: Recognize SNBs in SecondsSinceLastHeard
Timestamp is taken on each OTA beacon reception, and considered in the
SecondsSinceLastHeard property.
2019-12-24 10:38:34 -08:00
Brian Gix
bdfae8a570 mesh: Deliver newly composed SNBs to local nodes 2019-12-24 10:38:34 -08:00
Michał Lowas-Rzechonek
b9a4d9410b mesh: Fix getting managed objects from ObjectManager
D-Bus spec mandates that GetManagedObjects method of
org.freedesktop.DBus.ObjectManager interface returns *children* only:

https://dbus.freedesktop.org/doc/dbus-specification.html
> All returned object paths are children of the object path implementing
> this interface, i.e. their object paths start with the ObjectManager's
> object path plus '/'

Both test scripts and ELL abuse this by returning application interfaces
via ObjectManager attached to the same path, but other D-Bus
implementations do not, making Attach() fail because mandatory
interfaces cannot be found.

This patch fixes the issue by scanning hierarchy returned by
GetManagedObjects for object implementing org.bluez.mesh.Application1
interface and keeping that as node's app_path.
2019-12-18 07:46:16 -08:00
Inga Stotland
4a1bea28b1 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.
2019-12-16 14:52:36 -08:00
Brian Gix
6a83d14670 mesh: Cleanup unused LPN code
The daemon does not support the LPN role, and this is unreferenced code.
2019-12-16 08:18:35 -08:00
Brian Gix
9955657fa2 mesh: Refactor Secure Network Beaconing
The daemon handles multiple nodes, that may or may not be on the same
mesh network.  While each node my be seperately configured to beacon or
not beacon, there is nothing gained (except redundent traffic) for each
node to beacon seperately.  Beaconing is therefore centralized with the
Network Key the SNB represents, with each *received* beacon delivered
to each node. But for SNBs generated, we keep a count of how many nodes
want beacons sent for a specific key. If 1 or more, we beacon, if 0
nodes want the beacon sent, then we do not beacon.
2019-12-16 08:18:20 -08:00
Inga Stotland
3ed6e9f90c mesh: Add more checks for element properties
This adds consistency checks for mandatory properties on
org.bluez.mesh.Element1 interface:
    - disallow duplicate models on the same element
    - disallow elements with duplicate indices
    - disallow configuration server model on any element but primary
2019-12-15 09:36:10 -08:00
Inga Stotland
3228ce1472 mesh: Remove redundant code in mesh IO mgmt
This removes unnecessary housekeeping for hci controllers
2019-12-15 09:33:37 -08:00