platform/upstream/bluez.git
4 years agomesh: Fix Relaying for multiple nodes
Brian Gix [Fri, 18 Jan 2019 17:39:44 +0000 (09:39 -0800)]
mesh: Fix Relaying for multiple nodes

Relay is now a cooperation between all the nodes on the daemon.
If any one or more nodes have relay enabled and a received packet
is addressed to a Group, or a non-present Unicast address, then the
packet's TTL is decremented and it is resent.

Change-Id: I27d5555a9d530fc91a0c8f835feba9f2563ff68d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Cleanup PB-ADV transport on Prov Close
Brian Gix [Mon, 14 Jan 2019 22:52:15 +0000 (14:52 -0800)]
mesh: Cleanup PB-ADV transport on Prov Close

PB-ADV always used for provisioning, so must always  be cleaned up.

Change-Id: I37bc5f68e032b32942b0e909d3836d260a5c2f1e
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Clean up when finishing the Join call
Inga Stotland [Sat, 12 Jan 2019 02:40:55 +0000 (18:40 -0800)]
mesh: Clean up when finishing the Join call

Consolidate multiple instances where the pending Join data is freed
into calling one function free_pending_join_call().

Also, add checks for NULL data in cleanup functions for storage, agent
and provisioning acceptor.

Change-Id: I7a93d4f003f090f705be2f1f7af96349d10bdd1c
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Fix reading device UUID from Join() call
Inga Stotland [Sat, 12 Jan 2019 02:40:54 +0000 (18:40 -0800)]
mesh: Fix reading device UUID from Join() call

Supply correct parameters to l_dbus_message_iter_get_fixed_array
to get the location from where to read UUID value.

Change-Id: I0e2af0142882efb4d1079953a2a380dd9606dbdd
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: remove uneeded BDADDR type check
Brian Gix [Thu, 10 Jan 2019 23:22:28 +0000 (15:22 -0800)]
mesh: remove uneeded BDADDR type check

BT_HCI_EVT_LE_ADV_REPORT only comes from legal LE events

Change-Id: Ib98dcba6afb307fca4d5cc07ba1ff5d2fd1129bd
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Sample Mesh Joiner (provision acceptor)
Inga Stotland [Fri, 14 Dec 2018 22:19:08 +0000 (14:19 -0800)]
mesh: Sample Mesh Joiner (provision acceptor)

This implements a simple test to excercise Join() method
of org.bluez.mesh.Network interface.

Change-Id: I7c35ba8d979ac19ab2ca07b32551fae39dea9cd4
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Sample On/Off Client and Server
Inga Stotland [Fri, 14 Dec 2018 22:14:19 +0000 (14:14 -0800)]
mesh: Sample On/Off Client and Server

These tests excercise the following methods:
interface org.bluez.mesh.Network - Attach()
interface org.bluez.mesh.Node - Send(), Publish()

Change-Id: Ibeb7ed009000d6cf92e6927fefd2d8466a2df3da
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Sample Provisioning Agent
Inga Stotland [Fri, 14 Dec 2018 22:13:25 +0000 (14:13 -0800)]
mesh: Sample Provisioning Agent

This implements a simple provisioning agent to test
org.bluez.mesh.ProvisionAgent interface.

Change-Id: Ia9e3b842abe98cbb9fb1c22bc0e489a07c18b564
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add default location for Mesh Node storage
Inga Stotland [Fri, 14 Dec 2018 22:09:20 +0000 (14:09 -0800)]
mesh: Add default location for Mesh Node storage

Change-Id: I3f1581a7bce759df96c9df111aaaf5df73bb4f8c
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Update init for D-Bus and multi-node support
Inga Stotland [Fri, 14 Dec 2018 22:08:23 +0000 (14:08 -0800)]
mesh: Update init for D-Bus and multi-node support

This adds D-Bus initialization, modifications for mulitple nodes and
optional control of storage directory location.

Change-Id: I4f1a637a2e27e23ffb797f14bb60552f130ac531
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Clean up debug logging and comment style
Brian Gix [Fri, 14 Dec 2018 22:07:46 +0000 (14:07 -0800)]
mesh: Clean up debug logging and comment style

Change-Id: I1c104b78e2009624cc80687c22f5cdc41d664560
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Clean up App Key configuration and storage
Inga Stotland [Fri, 14 Dec 2018 22:07:19 +0000 (14:07 -0800)]
mesh: Clean up App Key configuration and storage

Fix miscellaneous issues: use l_debug instead of l_info for debug logs;
remove "local" from functions names (this handles only local app keys);
add missing App Key index initialization.

Change-Id: I337234997deea5113521ac930aa9321ae1d8e2b6
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Implement Provisioning Agent D-Bus interface
Inga Stotland [Fri, 14 Dec 2018 22:06:18 +0000 (14:06 -0800)]
mesh: Implement Provisioning Agent D-Bus interface

This implements the time limited and user interaction D-Bus API as
required for Out-Of-Band authentication during provisioning, and as
described in doc/mesh-api.txt.

Change-Id: I1953ddeb53428c180677a9f25a0912df700d3de2
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Restructure model services for multiple nodes
Inga Stotland [Fri, 14 Dec 2018 22:05:36 +0000 (14:05 -0800)]
mesh: Restructure model services for multiple nodes

This handles checking that incoming Mesh messages obey all
authentication rules regarding subscriptions and encryption
key bindings on a per node basis, before forwarding via D-Bus
to external applications that are authorized to handle them.

Change-Id: Ief00a963ad88fddb580fc2ab369f99ae5c4bfd99
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add support for storage of multiple nodes
Inga Stotland [Fri, 14 Dec 2018 22:05:04 +0000 (14:05 -0800)]
mesh: Add support for storage of multiple nodes

Add functionality to support storage of multiple subnets, model
subscriptions and publications per mesh node.

Change-Id: I0313f81cd16da18b621d08154489645aa06c7f42
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Restructure I/O for multiple controllers
Brian Gix [Fri, 14 Dec 2018 22:04:25 +0000 (14:04 -0800)]
mesh: Restructure I/O for multiple controllers

Restructured access to Bluetooth Controllers to allow the usage of
multiple controllers, and potentially functionality tailored to Mesh
specific features.

Change-Id: I159e9ec0e2e314cf810c45e89645f8c8edeb0df1
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add multi-node support to Config Server model
Inga Stotland [Fri, 14 Dec 2018 22:03:10 +0000 (14:03 -0800)]
mesh: Add multi-node support to Config Server model

The Config Server model is rewritten to allow control of mutiple nodes
on the local device. The updates to a node configuration (e.g., keys,
model subscriptions/publications, etc.) as set by a remote Config Client
are routed to a properly addressed node and stored in a protected
configuration file corresponding to that node.

Change-Id: I15e2ef8e1144fa85c9ec60991385b276ea36c6ce
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Implement org.bluez.mesh.Network API
Inga Stotland [Fri, 14 Dec 2018 22:01:50 +0000 (14:01 -0800)]
mesh: Implement org.bluez.mesh.Network API

This implements the following methods of org.bluez.mesh.Network
interface: Join(), Attach(), Cancel(). The methods are described in
doc/mesh-api.txt document.

Also, add changes to reflect that the single daemon now handles multiple
local mesh nodes.

Change-Id: Ic1cfd06b7d808957fcac1b4b06f2cc48b970b454
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Re-arrange provisioning for DBus API
Brian Gix [Fri, 14 Dec 2018 22:00:56 +0000 (14:00 -0800)]
mesh: Re-arrange provisioning for DBus API

This restructures provisioning so that it is a service of high level
d-Bus based API and may be potentially used on mulitple provisioning
transports.

Change-Id: I895d87a41a940474c47b1911e2b1f95a79d061a4
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add hex string and debug logging utilities
Inga Stotland [Fri, 14 Dec 2018 22:00:30 +0000 (14:00 -0800)]
mesh: Add hex string and debug logging utilities

This adds frequently used functionaility for logging and
saving/retrieval of long (128+ bit) hexidecimal data.

Change-Id: I1dfeeeea4f0d968b0f1b053edd8f312e73adf61d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Set unchanging variables to const
Brian Gix [Fri, 14 Dec 2018 21:59:46 +0000 (13:59 -0800)]
mesh: Set unchanging variables to const

Change-Id: I361ae143a3e65778e90bfa379adae33cec0d1e7a
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Rewrite Controler interface for full init
Brian Gix [Fri, 14 Dec 2018 21:58:26 +0000 (13:58 -0800)]
mesh: Rewrite Controler interface for full init

Functionaility has been added to allow a BT 4.0 or later controller
to be used for Advertising based Mesh usage, regardless of how it
was previously initialized.

Change-Id: I85c70ef84b534f0ab5ff1df88374349521dc7647
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Implement provisioning initiator side
Brian Gix [Fri, 14 Dec 2018 21:57:23 +0000 (13:57 -0800)]
mesh: Implement provisioning initiator side

This functionaility (originally found in provision.c) was rewritten
as the Initiator side only of the provisioning procedure.  If the
local device owns and controls access to a mesh network, this is the
side of the provisioning procedure that it must use to bring new
unprovisioned devices into the network as Nodes.

Change-Id: Ib17a26a63298d2d00ad362c9b55a44a4d142079a
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Implement provisioning acceptor
Brian Gix [Fri, 14 Dec 2018 21:56:34 +0000 (13:56 -0800)]
mesh: Implement provisioning acceptor

This implements acceptor side of the provisioning procedure when an
unprovisioned device is brought into an existing mesh network by a
remote Provisioner. Upon the successful completion of the procedure
the device becomes a participating mesh node in thie network.

Change-Id: I48dd146273be968edcf707526380505f829ba3fa
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add direction agnostic PB-ADV implementation
Brian Gix [Fri, 14 Dec 2018 21:55:56 +0000 (13:55 -0800)]
mesh: Add direction agnostic PB-ADV implementation

Originally found in prov.c, this file implements the PB-ADV
provisioning transport.  It may be used by either the
Acceptor or the Initiator side of the Provisioning procedure,
but only one session may be active at a time.

Change-Id: I13c6f05eaa6d574b3b8b43715221e8c5ed909419
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Rewrite Network layer for multiple nodes
Brian Gix [Fri, 14 Dec 2018 21:55:14 +0000 (13:55 -0800)]
mesh: Rewrite Network layer for multiple nodes

The Network layer of the Mesh Daemon has access to all
network keys that have been entrusted to Nodes on the local
device, and acts as a MUX by forwarding incoming messages
to some, all or none of the local Nodes, based on addressing
and keys.

It also is reponsible for for applying Network layer encryption
to outgoing messages, and for relaying messages based on TTL.

Change-Id: I41f5ebc5902ff67caa3e28754360db2b81e1ed6d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add org.bluez.mesh.Node D-Bus API support
Inga Stotland [Fri, 14 Dec 2018 21:54:17 +0000 (13:54 -0800)]
mesh: Add org.bluez.mesh.Node D-Bus API support

Add support for maintaining multiple local nodes within a single daemon.
A mesh node is an adressable entity in Bluetooth mesh. A local mesh
capable device may have multiple distinct representations as a mesh
node on different mesh networks. Each such representation (aka "node
configuration") maintains runtime storage of encryption/decryption
keys, model subscriptions and publications, etc.

Also, implement D-Bus methods for org.bluez.mesh.Node interaface:
Send(), Publish(), VendorPublish()

Also, add support for generating temporary mesh node entity for Join()
method and verification of credentials for Attach() method

Change-Id: Iaacde1ab11c7859f5b2c9714d66046768c351c66
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Rewrite storage for multiple nodes
Inga Stotland [Fri, 14 Dec 2018 21:53:19 +0000 (13:53 -0800)]
mesh: Rewrite storage for multiple nodes

Multiple node configurations are now stored in priviledged location
to prevent unauthorized access to the security material entrusted to
each node.
Default storage location is /var/lib/bluetooth/mesh.

Change-Id: I18e2100e344c697cf564dbcb2a20f69b06b09379
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Internal errors
Inga Stotland [Fri, 14 Dec 2018 21:52:39 +0000 (13:52 -0800)]
mesh: Internal errors

Add error codes that map to specific faults that may occur while
using the mesh D-Bus API.

Change-Id: I6aa57abd0303a87c900bf448e54595ffe1789776
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add utilities for DBus support
Inga Stotland [Fri, 14 Dec 2018 21:48:59 +0000 (13:48 -0800)]
mesh: Add utilities for DBus support

These files implement helper routines for common D-Bus functionality.

Change-Id: Ic6d828ebbc828d40ca103476974cded374cdd79c
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Structural changes for mesh
Brian Gix [Fri, 14 Dec 2018 21:46:45 +0000 (13:46 -0800)]
mesh: Structural changes for mesh

Delete composition.json since it not used for initialization anymore.
Delete btmesh.c as it is not used anymore.
Delete display.c and display.h, move retained functionality to util.c
Delete prov.c, move retained PB-ADV functionality to pb-adv.c
Delete provision.c, split retained functionality between
prov-acceptor.c and prov-initiator.c

Change-Id: I419cc368361b8b339138bbbe4525cb5599c70383
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agodoc: Update mesh Agent API
Inga Stotland [Mon, 3 Dec 2018 03:29:50 +0000 (19:29 -0800)]
doc: Update mesh Agent API

Change enumerated values to strings in method parameters, and
corrected formatting for 80 character terminals.

Change-Id: I42bbbbfde235ae1389979c3b7176ae4266e3f719
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agodoc: Initial Bluetooth Mesh API
Inga Stotland [Tue, 20 Nov 2018 07:29:05 +0000 (23:29 -0800)]
doc: Initial Bluetooth Mesh API

This decribes proposed D-Bus based API for Bluetooth Mesh
implementation.

Change-Id: Ib8949de722335c0247ab147755d333259b1708b7
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Avoid loop variable initial declarations
Marcel Holtmann [Tue, 4 Dec 2018 16:30:42 +0000 (17:30 +0100)]
mesh: Avoid loop variable initial declarations

Change-Id: I68cfa8352c77ff8c562096bd822742a86056a6f5
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agobuild: Add missing mesh/appkey.h header file
Marcel Holtmann [Mon, 3 Dec 2018 20:18:23 +0000 (21:18 +0100)]
build: Add missing mesh/appkey.h header file

Change-Id: I78422ddc220bd213787e7777939be25aecea996c
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Fix various compiler warnings
Marcel Holtmann [Mon, 3 Dec 2018 18:54:33 +0000 (19:54 +0100)]
mesh: Fix various compiler warnings

Change-Id: I5fc0e3d8b16da52e3669803d6905e85656c31860
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Up-rev ELL dependancies to >= 0.14
Brian Gix [Thu, 22 Nov 2018 19:37:32 +0000 (11:37 -0800)]
mesh: Up-rev ELL dependancies to >= 0.14

Change-Id: Ic057c4ea331156e8694104da225681fdb6b887fd
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomeshctl: Switch from write to sendmsg for Acquire*
Luiz Augusto von Dentz [Mon, 19 Nov 2018 15:35:54 +0000 (17:35 +0200)]
meshctl: Switch from write to sendmsg for Acquire*

Use sendmsg with MSG_NOSIGNAL to prevent crashes involving SIGPIPE.

Change-Id: I25fde6c1e91642a887c4705d4861d01fb134bf95
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Refactor friend.c and net.c for central key DB
Brian Gix [Tue, 18 Sep 2018 19:40:08 +0000 (12:40 -0700)]
mesh: Refactor friend.c and net.c for central key DB

To enable multiple local nodes and friendships to
coexist, and minimize redundant encryption processing

Change-Id: I41ef270909c3d38391f31a922d48d35da2d56b10
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add centralized caching Net Key management
Brian Gix [Fri, 7 Sep 2018 21:45:04 +0000 (14:45 -0700)]
mesh: Add centralized caching Net Key management

Change-Id: I804c51cbe75d8ea0a42b7982a37aef8311de6b0c
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add clean up on start up failure
Inga Stotland [Fri, 7 Sep 2018 23:25:44 +0000 (16:25 -0700)]
mesh: Add clean up on start up failure

Call bt_shell_clanup if failed to start the tool.

Change-Id: I58a85628546e20a51065ab02b54f2145a8425d57
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add start up management command chain
Inga Stotland [Wed, 5 Sep 2018 00:20:34 +0000 (17:20 -0700)]
mesh: Add start up management command chain

This allows co-existense of meshd and bluetoothd. meshd will
automatically take control of the first available LE-capable
controller that is powered down.

Change-Id: If5f27e4215ace969e37f72928259fb35923d4a24
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agotools/meshctl: Fix default directory for JSON files
Inga Stotland [Wed, 29 Aug 2018 18:25:55 +0000 (11:25 -0700)]
tools/meshctl: Fix default directory for JSON files

This fixes the name of default directory that contains sample JSON files.
README file is updated to describe the default location.

Change-Id: Ie702dd3079df95d043196bbf5a3f85d54077369b
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Fix uninitilized error
Luiz Augusto von Dentz [Fri, 24 Aug 2018 14:49:02 +0000 (17:49 +0300)]
mesh: Fix uninitilized error

This fixes the following error:

mesh/cfgmod-server.c: In function â€˜cfg_srv_pkt’:
mesh/cfgmod-server.c:103:5: error: â€˜pub’ may be used uninitialized in
this function [-Werror=maybe-uninitialized]

Change-Id: I18473c1c16bd02b208d679422cd4ed354108b77d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Fixed warning-to-error from GCC 8.1.1
Brian Gix [Thu, 23 Aug 2018 20:08:54 +0000 (13:08 -0700)]
mesh: Fixed warning-to-error from GCC 8.1.1

Fixed compiler flagged unsafe usage of strncpy

Change-Id: Ie69c5914eb48a608e2252794e0e5b87135ff5211
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoAUTHORS: add Mesh maintaining authors
Brian Gix [Wed, 22 Aug 2018 19:10:55 +0000 (12:10 -0700)]
AUTHORS: add Mesh maintaining authors

Change-Id: Ifb1b521d786562e1ba64fa1e032007254909c6c6
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoMakefile for meshd
Inga Stotland [Sat, 14 Jul 2018 19:59:03 +0000 (12:59 -0700)]
Makefile for meshd

Tizen Change: Currently mesh daemon build is disabled

Change-Id: I85bc5d9c11e39115024b0bb498aafb462d912e73
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Sample device composition in JSON format
Inga Stotland [Sat, 14 Jul 2018 19:59:02 +0000 (12:59 -0700)]
mesh: Sample device composition in JSON format

This is a sample unprovisioned device composition described
in JSON format.

Change-Id: I52ce0e669c18237fb50f1fa5d035ae076dd26f6f
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Read and write mesh configuration in JSON format
Inga Stotland [Sat, 14 Jul 2018 19:59:01 +0000 (12:59 -0700)]
mesh: Read and write mesh configuration in JSON format

This adds implementation for parsing and writing Mesh configuration
into JSON format. Also, parse stored unprovisioned device composiotion.

Change-Id: Ia280ef53a7f170001494d15bd70b1d884cdabb58
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Mesh config server model
Inga Stotland [Sat, 14 Jul 2018 19:59:00 +0000 (12:59 -0700)]
mesh: Mesh config server model

Change-Id: Ib400910064ff64cdcb8f323675e4be4aa656aee8
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Source code for handling access layer mux/demux
Inga Stotland [Sat, 14 Jul 2018 19:58:59 +0000 (12:58 -0700)]
mesh: Source code for handling access layer mux/demux

Change-Id: Ia5cac2a4c9751bee26026db54384846c435bcc49
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Source files for mesh access layer and utilities
Inga Stotland [Sat, 14 Jul 2018 19:58:58 +0000 (12:58 -0700)]
mesh: Source files for mesh access layer and utilities

This adds initial implementation of BT Mesh access layer
functionality plus utilities.

Change-Id: Ib83a570b34c334153c0174d2bd1dbf9cebce4cc3
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Header files for mesh access layer and utilities
Inga Stotland [Sat, 14 Jul 2018 19:58:57 +0000 (12:58 -0700)]
mesh: Header files for mesh access layer and utilities

This adds initial implementation of Mesh access layer functionality

Change-Id: I142ef204a0efffe279e2b7cf3208f018f83d6b50
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add Accessors to Transport layer data
Brian Gix [Sat, 14 Jul 2018 19:58:56 +0000 (12:58 -0700)]
mesh: Add Accessors to Transport layer data

Change-Id: Icefad134ee878cc4866ccb27c9d65e83e503097f
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Upper and Lower mesh transport
Brian Gix [Sat, 14 Jul 2018 19:58:55 +0000 (12:58 -0700)]
mesh: Upper and Lower mesh transport

Change-Id: I0624c9f43ecde27c00d3003954c642d99df4cc34
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Provisioning logic for mesh
Brian Gix [Sat, 14 Jul 2018 19:58:54 +0000 (12:58 -0700)]
mesh: Provisioning logic for mesh

Change-Id: I1393239458d07d69a23770a229836b5f0663f8cd
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Initial Mesh Friendship support
Brian Gix [Sat, 14 Jul 2018 19:58:53 +0000 (12:58 -0700)]
mesh: Initial Mesh Friendship support

Change-Id: Ie0293ff6312d2987dbb120936e059e99f70bfa48
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Infrastructure for Mesh daemon
Brian Gix [Sat, 14 Jul 2018 19:58:52 +0000 (12:58 -0700)]
mesh: Infrastructure for Mesh daemon

Change-Id: I0738f7295f69a8229e3a09f67ae6399b6839e8b1
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Mesh crypto support
Brian Gix [Sat, 14 Jul 2018 19:58:51 +0000 (12:58 -0700)]
mesh: Mesh crypto support

Change-Id: Ieffb5c2aff17ee823a770362ca71c1afea064f9f
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Shared private meshd interfaces
Brian Gix [Sat, 14 Jul 2018 19:58:50 +0000 (12:58 -0700)]
mesh: Shared private meshd interfaces

Change-Id: I5cfc75e29a139410c74aa82c4272f284171b2405
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agotools/mesh: Fix reclaiming address range
Inga Stotland [Wed, 15 Aug 2018 20:16:52 +0000 (13:16 -0700)]
tools/mesh: Fix reclaiming address range

The computations for reclaiming released unicast addresses back
into address pool were off by 1. Also, the adjacent pools need
to be merged, if the released range fills the gap between two
address pools.

Change-Id: If420d6a914067880250d78f6de955a071fcf5fe7
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agotools: Move meshctl sources under tools/mesh directory
Inga Stotland [Fri, 22 Jun 2018 06:32:00 +0000 (23:32 -0700)]
tools: Move meshctl sources under tools/mesh directory

This is a temporary location until the unified mesh solution is provided

Change-Id: I1496ad64c492442a12e0920f67a34fc48297a088
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agotools: Move meshctl tool under tools directory
Inga Stotland [Fri, 22 Jun 2018 06:31:59 +0000 (23:31 -0700)]
tools: Move meshctl tool under tools directory

Change-Id: I17f7a3e16b325614ad68f537ee5d7152ec64e006
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add ELL support in Bluez build 08/220208/1
Anupam Roy [Fri, 13 Dec 2019 10:25:48 +0000 (15:55 +0530)]
mesh: Add ELL support in Bluez build

Note: In Tizen bluez, ELL will be built internally.
BLE mesh modules like mesh-cfgclient & bluetooth-mesh daemon
will be linked against the librarties generated by ELL build.

This patch refers to following upstream patch.

==================================================================
 commit 0093cd61b1e4f199bca45f8c2f8eb2d5a30e847d
 Author: Marcel Holtmann <marcel@holtmann.org>
 Date:   Tue Dec 4 16:59:01 2018 +0100

 build: Add support for internal and external ELL configuration
==================================================================

Change-Id: I232c2737964e0c6d56abc7a794f9f75606dc6472
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: add source for ell shared library 07/220207/1
Anupam Roy [Fri, 13 Dec 2019 10:03:35 +0000 (15:33 +0530)]
mesh: add source for ell shared library

Change-Id: I5951addf984e0e67bf8d3dcf89b89ba648c14064
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agomesh: Add ELL support in Bluez 06/220206/1
Anupam Roy [Fri, 13 Dec 2019 09:30:21 +0000 (15:00 +0530)]
mesh: Add ELL support in Bluez

This is a pre-requisute patch which adds ELL
source & headers inside Tizen bluez source.

In Tizen bluez, ELL will be built internally.
BLE mesh modules like mesh-cfgclient & bluetooth-mesh daemon
will be linked against the libraries generated by ELL build.

Note: ELL source build will be enabled in next patchset

Change-Id: I91d4a31326810820ed644816cfba8fd8ae93952d
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoAdd check logic of browsing_io before channel shutdown 36/219436/4 accepted/tizen/5.5/unified/20191210.221211 submit/tizen_5.5/20191206.000647
Wootak Jung [Thu, 5 Dec 2019 01:05:53 +0000 (10:05 +0900)]
Add check logic of browsing_io before channel shutdown

Dec 05 09:38:13 localhost bluetoothd[2772]: GLib: g_io_channel_shutdown:
assertion 'channel != NULL' failed
Dec 05 09:38:13 localhost bluetoothd[2772]: GLib: g_io_channel_unref:
assertion 'channel != NULL' failed

Change-Id: Ife5a32397567a16806cfb6c15598ef88b6a438ee

4 years agoMerge "Remove unnecessary method calls" into tizen
Pyun DoHyun [Thu, 5 Dec 2019 04:19:07 +0000 (04:19 +0000)]
Merge "Remove unnecessary method calls" into tizen

4 years agoRemove unnecessary method calls 87/219287/1
Wootak Jung [Wed, 4 Dec 2019 04:52:15 +0000 (13:52 +0900)]
Remove unnecessary method calls

Calling Release() method generates below unnecessary dbus error.
Moreover, no need to call this method because cleanup process is
already done.

Dec 04 09:57:15 localhost dbus[2637]: [system] Rejected send message,
1 matched rules; type="error", sender=":1.3" (uid=122 pid=2562 comm=
"/usr/bin/pulseaudio ") interface="(unset)" member="(unset)" error n
ame="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply=
"0" destination=":1.207" privilege="(n/a)" (uid=551 pid=3891 comm="/
usr/libexec/bluetooth/bluetoothd -d -C ") rule(<deny send_destinatio
n="org.bluez" />)

Feb 26 23:56:47 localhost dbus[2521]: [system] Rejected send message,
1 matched rules; type="error", sender=":1.59" (uid=651 pid=3025 comm=
"/usr/bin/sapd ") interface="(unset)" member="(unset)" error name="or
g.freedesktop.DBus.Error.UnknownMethod" requested_reply="0" destinati
on=":1.334" privilege="(n/a)" (uid=551 pid=8104 comm="/usr/libexec/bl
uetooth/bluetoothd -d -C ") rule(<deny send_destination="org.bluez" />)

Change-Id: I6ad605d2621be1e7a2800cd11217d157da86607a

4 years agoCalls sd_notify(STOPPING=1) to ensure systemd's operation 81/219181/1
DoHyun Pyun [Tue, 3 Dec 2019 01:52:33 +0000 (10:52 +0900)]
Calls sd_notify(STOPPING=1) to ensure systemd's operation

Change-Id: I287a8f72156c2f386a8e824f2099abec2757e761
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoAdd A2dpRole property in the adapter interface 98/218698/2 accepted/tizen/5.5/unified/20191203.011319 accepted/tizen/unified/20191128.161924 submit/tizen/20191128.024748 submit/tizen_5.5/20191127.215640
DoHyun Pyun [Wed, 27 Nov 2019 06:00:47 +0000 (15:00 +0900)]
Add A2dpRole property in the adapter interface

Change-Id: I818c3a65b700783fb11b5c67fad8af9149a33ee9
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoAdd new dbus rule for HID GetFD 87/218287/1
Deokhyun Kim [Thu, 21 Nov 2019 05:34:12 +0000 (14:34 +0900)]
Add new dbus rule for HID GetFD

Change-Id: I314bcdddd71d83e733cd90565d25d1005f5f8bfe
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
4 years agoFix response_needed not set issue 76/217876/1 accepted/tizen/5.5/unified/20191118.084835 accepted/tizen/5.5/unified/20191120.130938 accepted/tizen/5.5/unified/20191121.073247 accepted/tizen/unified/20191118.122944 submit/tizen/20191115.070745 submit/tizen_5.5/20191115.070441 submit/tizen_5.5/20191115.070934 submit/tizen_5.5/20191118.005342 submit/tizen_5.5/20191118.011157 submit/tizen_5.5/20191119.233738
Wootak Jung [Fri, 15 Nov 2019 06:52:40 +0000 (15:52 +0900)]
Fix response_needed not set issue

write request is failed on server side because
response_needed is not set.

Change-Id: Id63b9e8dda44917ec5442b3224c136952c69c4fc

5 years agoRevert "Fix: ConnectProfiles never be returned" 03/216303/1 accepted/tizen/unified/20191101.042116 submit/tizen/20191031.005137
Deokhyun Kim [Wed, 23 Oct 2019 07:01:42 +0000 (16:01 +0900)]
Revert "Fix: ConnectProfiles never be returned"

This reverts commit 1d77526f4dad3e322504a780770836129931796a

When prior connection fails, dev->connect was not released
Release connect resources when connection fails

// First connect
Oct 17 14:30:55 localhost bluetoothd[6459]: src/device.c:connect_profiles() /org/bluez/hci0/dev_XX_XX_XX_XX_EB_3C 0000111e-0000-1000-8000-00805f9b34fb, client :1.18
Oct 17 14:31:00 localhost bluetoothd[6459]: src/device.c:device_profile_connected() Hands-Free Audio Gateway Host is down (112)
Oct 17 14:31:00 localhost bluetoothd[6459]: src/device.c:connect_profiles() /org/bluez/hci0/dev_XX_XX_XX_XX_EB_3C 0000110b-0000-1000-8000-00805f9b34fb, client :1.18
Oct 17 14:31:01 localhost bluetoothd[6459]: src/device.c:device_profile_connected() a2dp-sink Resource temporarily unavailable (11)

// Second connect
Oct 17 14:32:10 localhost bluetoothd[6459]: src/device.c:connect_profiles() /org/bluez/hci0/dev_XX_XX_XX_XX_EB_3C 0000111e-0000-1000-8000-00805f9b34fb, client :1.18
10-17 14:32:10.327+0900 E/BLUETOOTH_FRWK_SERVICE(P 2694, T 2694): bt-service-audio.c: __bt_audio_request_cb(781) > Audio Connect/Disconnect Dbus Call Error: GDBus.Error:org.bluez.Error.InProgress: In Progress

Change-Id: I8caa4f43f51a7b302b5afc8a5028a22776d97cf5
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoFix weak point of scan filter logic 06/216206/1
Deokhyun Kim [Tue, 22 Oct 2019 08:29:20 +0000 (17:29 +0900)]
Fix weak point of scan filter logic

Change-Id: I02138cc41598cef11544ea7edf9c8d0230074a8f
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoFix : LE connection interval is not updated 35/216135/1
injun.yang [Mon, 21 Oct 2019 08:50:20 +0000 (17:50 +0900)]
Fix : LE connection interval is not updated

[Problem] If remote device use LE public address, unable to update LE connection interval
[Cause & Measure] Change the comparison logic to get object
[Checking Method] Connect BLE with LE public address > Repeat interval configuration

Change-Id: I2413e0f0c36918daba91bfb465d549c0e39532a9

5 years agoFix : LE connection interval is not updated 76/215876/1
injun.yang [Thu, 17 Oct 2019 05:23:40 +0000 (14:23 +0900)]
Fix : LE connection interval is not updated

[Problem] Unable to update LE connection interval with iPhone
[Cause & Measure] When LE connection updated callback invoked,
 bluez handle it as IDA object instead of first RPA object.
 so change the comparison logic to get RPA object
[Checking Method] Both BLE and BREDR connectd with iPhone > Repeat interval configuration

Change-Id: I87578681fc35041801e28a251a914e9bb52ff49d

5 years agoGATT Server : Handle response_needed by write request & command 61/215761/2
Deokhyun Kim [Tue, 15 Oct 2019 11:23:34 +0000 (20:23 +0900)]
GATT Server : Handle response_needed by write request & command

Change-Id: I962b9a512d9114e80ca9b5c39d62f4d76e22fce4
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoMerge "Use the systemd service for obexd" into tizen accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.004956 accepted/tizen/5.5/unified/mobile/hotfix/20201027.061849 accepted/tizen/unified/20190924.062104 submit/tizen/20190923.085748 submit/tizen_5.5/20191031.000006 submit/tizen_5.5_mobile_hotfix/20201026.185106 tizen_5.5.m2_release
Pyun DoHyun [Mon, 23 Sep 2019 08:53:52 +0000 (08:53 +0000)]
Merge "Use the systemd service for obexd" into tizen

5 years agoFix NULL pointer dereferencing issue 86/214486/1
Wootak Jung [Mon, 23 Sep 2019 08:32:09 +0000 (17:32 +0900)]
Fix NULL pointer dereferencing issue

Change-Id: I42db1cb8239519c6d796a0e83bd08c0aca5498ad

5 years agoUse the systemd service for obexd 13/214413/2
DoHyun Pyun [Mon, 23 Sep 2019 02:34:23 +0000 (11:34 +0900)]
Use the systemd service for obexd

Change-Id: I988e2e18cb168b35b5e462e0f3d80e060abd8e5b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agoEnable HID device feature 52/213952/1 accepted/tizen/unified/20190918.010302 submit/tizen/20190916.233704
DoHyun Pyun [Tue, 17 Sep 2019 03:51:08 +0000 (12:51 +0900)]
Enable HID device feature

Change-Id: I5f469bb0395709eba5e730304f7fdfaa0c38d8a3
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agoEmit signal for MTU changed event 53/213853/1
injun.yang [Mon, 1 Jul 2019 08:02:56 +0000 (17:02 +0900)]
Emit signal for MTU changed event

[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] Unable to notice MTU changed event to application
[Cause & Measure] Send signal to detect MTU changed event on GATT server
[Checking Method] n/a

[Team] Convergence BT
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: Ic9446ee005211a6805a7e62791c03b410d3ff0a1
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agoRestart vsc advertising after 300 ms 62/213762/1
injun.yang [Wed, 11 Sep 2019 06:02:55 +0000 (15:02 +0900)]
Restart vsc advertising after 300 ms

Change-Id: I4399f413a771a23235564d94568c92026a08b709
Signed-off-by: injun.yang <injun.yang@samsung.com>
5 years agoWhen hci event missed, send tx timeout error 77/213677/1
injun.yang [Tue, 10 Sep 2019 05:54:56 +0000 (14:54 +0900)]
When hci event missed, send tx timeout error

Change-Id: I84a677862e82aac4ad280db740d0e535b170870b
Signed-off-by: injun.yang <injun.yang@samsung.com>
5 years agoAdd adapter_send_event function 78/213278/1 accepted/tizen/unified/20190904.110702 submit/tizen/20190903.224849
Wootak Jung [Wed, 4 Sep 2019 00:26:32 +0000 (09:26 +0900)]
Add adapter_send_event function

Change-Id: If0f8c4c1e605fe415b141efeba2485d6c52efc6a

5 years agoMerge "Recover adapter when 'hci command disallowed' is responded" into tizen
Pyun DoHyun [Tue, 3 Sep 2019 04:58:51 +0000 (04:58 +0000)]
Merge "Recover adapter when 'hci command disallowed' is responded" into tizen

5 years agoRecover adapter when 'hci command disallowed' is responded 22/213222/1
Deokhyun Kim [Tue, 3 Sep 2019 04:26:58 +0000 (13:26 +0900)]
Recover adapter when 'hci command disallowed' is responded

vsc adv status of controller is abnormal while le connection & disconnection
are repeated. Recover adapter when 'hci command disallowed' is responded.

Change-Id: I1d39f3160784799ff2d7af7ded8c9ea8b7f8c579
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoUse LE pairing for the headless plugin 09/213209/1
DoHyun Pyun [Tue, 3 Sep 2019 01:39:46 +0000 (10:39 +0900)]
Use LE pairing for the headless plugin

Change-Id: Iec41908ba265bbc5eafa8b82128d4d00f63e95e6
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agoNot set le_static_addr when initializing 87/212787/1 accepted/tizen/unified/20190827.110641 submit/tizen/20190827.022419
Deokhyun Kim [Tue, 27 Aug 2019 01:46:36 +0000 (10:46 +0900)]
Not set le_static_addr when initializing

Change-Id: Iebd1a33c9ffb28635336018b71cd817b2ca166d5
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoRemove OS upgrade script 98/212498/1
DoHyun Pyun [Thu, 22 Aug 2019 06:50:27 +0000 (15:50 +0900)]
Remove OS upgrade script

Since Tizen 4.0 there is no change for the file properties.
So we don't need to use the upgrade script for bluez.

Change-Id: I18b1b66a730fcbcfecfd51ade2e47de3baaefd09
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agoInit le static address when adapter is enabled 37/212437/1 accepted/tizen/unified/20190822.105955 submit/tizen/20190822.022402
Deokhyun Kim [Wed, 21 Aug 2019 11:04:10 +0000 (20:04 +0900)]
Init le static address when adapter is enabled

Change-Id: I19d079c6128535c1cfc637017a1e7048e82d04a7
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoImplement interface to set advertise Tx power level 78/211078/1 accepted/tizen/unified/20190801.025409 submit/tizen/20190730.223540
injun.yang [Tue, 23 Oct 2018 00:51:21 +0000 (09:51 +0900)]
Implement interface to set advertise Tx power level

[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] n/a
[Cause & Measure] Application will set advertise Tx power level
[Checking Method] n/a

[Team] Basic Connection
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I8dfa4b9aa94a9f0a3e7bc71a3cf2afa48cf77095
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agoApply avrcp ct connect timeout to 8 sec only for Bose speaker 58/210958/1 accepted/tizen/unified/20190729.081028 submit/tizen/20190729.004732
Deokhyun Kim [Fri, 26 Jul 2019 09:03:00 +0000 (18:03 +0900)]
Apply avrcp ct connect timeout to 8 sec only for Bose speaker

  - Race condition occurs when requesting L2CAP AVRCP connection
  Sometimes AVRCP connection request by Bose is delayed. It can conflict
  Apply avrcp ct connect timeout to 8 sec only for Bose speaker

Change-Id: Ib8ca44f61aae47b9c58af38999c6ce2959f3c6e7
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoFix the build error 11/210411/1 accepted/tizen/unified/20190719.111747 submit/tizen/20190719.013144
DoHyun Pyun [Fri, 19 Jul 2019 01:49:33 +0000 (10:49 +0900)]
Fix the build error

Change-Id: I7de706de85961109013e5e8cfa7abcea6545b22e
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
5 years agoRestrict AVRCP in case A2DP is restricted 61/210361/1
Deokhyun Kim [Thu, 18 Jul 2019 08:33:02 +0000 (17:33 +0900)]
Restrict AVRCP in case A2DP is restricted

Change-Id: I39b1d0a7aebd156c23264d175a7500e1879c545c
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
5 years agoDelete meaningless configuration 03/209503/1 accepted/tizen/unified/20190715.111841 submit/tizen/20190714.235650
INSUN PYO [Mon, 8 Jul 2019 10:35:01 +0000 (19:35 +0900)]
Delete meaningless configuration

Change-Id: I4c0756152fb27edcc69bacb272cfb407b9df53c5

5 years agoRemove unused features 63/209063/1 accepted/tizen/unified/20190703.110630 submit/tizen/20190702.052010
INSUN PYO [Tue, 2 Jul 2019 05:05:40 +0000 (14:05 +0900)]
Remove unused features

Change-Id: I1e467e6e4f6cde139d5d057fd0c9da733f72ff15

5 years agoRemove unnecessary setting 07/209007/1
INSUN PYO [Tue, 2 Jul 2019 01:34:48 +0000 (10:34 +0900)]
Remove unnecessary setting

Change-Id: I49d3c7fbd7be2d455451614cf1debd1e3c23e6c7

5 years agoCancel BLE connection attempt currently in progress 05/207605/1 accepted/tizen/unified/20190611.050054 submit/tizen/20190610.063128
injun.yang [Mon, 27 May 2019 06:21:42 +0000 (15:21 +0900)]
Cancel BLE connection attempt currently in progress

[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] Unable to abort BLE connection attempt
[Cause & Measure] Abort connection attempt and send "Cancelled" event to upper side
[Checking Method] Cancel BLE connection attempt

[Team] IoT Hub
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I8eb1edfa33a12a39ba6abc5f3838fc73e987d0ca
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>