Skip to content

Commit

Permalink
[nrfconnect] Added device type related kconfig options (#13691)
Browse files Browse the repository at this point in the history
There is no kconfig interface and documentation on how to enable
commissionable device types and set device type value.

* Added kconfig options for commissionable device types
and device type
* Extended examples documentation to describe the features
and how to enable them
  • Loading branch information
kkasperczyk-no authored Jan 20, 2022
1 parent b700fb8 commit 914ba3e
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ DataFrame
dataset
datasets
dbf
DBG
dBm
DBUILD
dbus
Expand Down Expand Up @@ -316,6 +317,7 @@ DMM
DNS
Dnsmasq
dnsmasqd
DNSSD
DNSStubListener
Dockerfile
Dockerfiles
Expand Down Expand Up @@ -650,6 +652,7 @@ MoveToSaturation
MoveWithOnOff
MPSL
MRP
MTD
MTU
Multiband
Multicast
Expand Down Expand Up @@ -940,6 +943,7 @@ submodules
subprocess
SubscribeResponse
SubscriptionId
subtype
sudo
svg
SVR
Expand Down
14 changes: 14 additions & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@ config CHIP_ROTATING_DEVICE_ID
Enables rotating device identifier that provides a non-trackable identifier
which is unique per device and rotates at pre-defined moments.

config CHIP_COMMISSIONABLE_DEVICE_TYPE
bool "Enable the device type subtype in commissionable node discovery record"
depends on CHIP_ENABLE_DNSSD_SRP
help
Enables including device type subtype in the commissionable node discovery record,
which allows filtering of the results to find the nodes that match the device type.

config CHIP_DEVICE_TYPE
int "Device type"
default 65535
range 0 65535
help
Type of device that uses the CHIP Device Type Identifier. The default value means invalid device type.

config CHIP_OPERATIONAL_TIME_SAVE_INTERVAL
int "Interval of saving node operation time to flash in hours unit"
default 10
Expand Down
82 changes: 82 additions & 0 deletions docs/guides/nrfconnect_examples_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,85 @@ Read the
guide in the nRF Connect SDK's Zephyr documentation if you are interested in
getting more advanced and detailed information about the configuration
structure.

<hr>

## Configuring Matter in nRF Connect platform

### Mandatory configuration

To use the Matter protocol, you need to set the `CONFIG_CHIP` Kconfig option.
Setting this option enables the Matter protocol stack and other associated
Kconfig options, including `CONFIG_CHIP_ENABLE_DNSSD_SRP` that is required for
the Matter device to be discoverable using DNS-SD.

After that, make sure to set the `CONFIG_CHIP_PROJECT_CONFIG` Kconfig option and
define the path to the configuration file that specifies Vendor ID, Product ID,
and other project-specific Matter settings.

<hr>

### Optional configuration

After enabling the Matter protocol and defining the path to the Matter
configuration file, you can enable additional options in Kconfig.

**Sleepy End Device support**

You can enable the support for Thread Sleepy End Device in Matter by setting the
following Kconfig options:

- `CONFIG_OPENTHREAD_MTD`
- `CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT`

**Commissioning with NFC support**

You can configure the Matter protocol to use an NFC tag for commissioning,
instead of using a QR code, which is the default configuration.

To enable NFC for commissioning and share the onboarding payload in an NFC tag,
set the `CONFIG_CHIP_NFC_COMMISSIONING` option.

**Logging**

You can enable logging for both the stack and Zephyr’s
[Logging](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/logging/index.html#logging-api)
API by setting the `CONFIG_LOG` option.

Zephyr allows you to configure log levels of different software modules
independently. To change the log level configuration for the Matter module, set
one of the available options:

- `CONFIG_MATTER_LOG_LEVEL_ERR`
- `CONFIG_MATTER_LOG_LEVEL_INFO`
- `CONFIG_MATTER_LOG_LEVEL_DBG`

**Shell**

You can enable the Matter shell library using the `CONFIG_CHIP_LIB_SHELL`
Kconfig option. This option lets you use the Matter specific shell commands. See
[Using CLI in nRF Connect examples](nrfconnect_examples_cli.md) for the list of
available Matter shell commands.

**Matter device identification**

Matter has many mandatory and optional ways to identify a specific device. These
can be used for various purposes, such as dividing devices into groups (by
function, by vendor or by location), device commissioning or vendor-specific
cases before the device was commissioned (for example, identifying factory
software version or related features).

Only some part of these features can be configured using Kconfig options and
only those were listed below:

- `CONFIG_CHIP_DEVICE_TYPE` - type of device that uses the Matter Device Type
Identifier, for example Door Lock (0x000A) or Dimmable Light Bulb (0x0101).
- `CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE` - enables including optional device
type subtype in the commissionable node discovery record, which allows
filtering of the discovery results to find the nodes that match the device
type.
- `CONFIG_CHIP_ROTATING_DEVICE_ID` - enables rotating device identifier, an
optional feature that provides an additional unique identifier for each
device. This identifier is similar to the serial number, but it additionally
changes at predefined times to protect against long-term tracking of the
device.
8 changes: 8 additions & 0 deletions src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,11 @@
#ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT
#define CHIP_DEVICE_CONFIG_ENABLE_SED 1
#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT

#ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1
#endif // CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE

#ifdef CONFIG_CHIP_DEVICE_TYPE
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE
#endif // CONFIG_CHIP_DEVICE_TYPE

0 comments on commit 914ba3e

Please sign in to comment.