Skip to content

Commit

Permalink
new: chef samples may specify Matter ports (#30471)
Browse files Browse the repository at this point in the history
* new: chef samples may specify Matter ports

* restyle

* fix: corrections to readme
  • Loading branch information
rochaferraz authored and pull[bot] committed Dec 20, 2023
1 parent 1d5fb30 commit 1041752
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/chef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,27 @@ Follow guide in [NEW_CHEF_DEVICES.md](NEW_CHEF_DEVICES.md).
- `chef.py`: main script for generating samples. More info on its help
`chef.py -h`.

## General Linux Options

When building chef for the Linux platform there are several options available at
runtime. These options are also available for many Linux samples. Do not
conflate these with chef options available at build time.

Ex.:

- --discriminator <discriminator>: A 12-bit unsigned integer match the value
which a device advertises during commissioning.
- --passcode <passcode>: A 27-bit unsigned integer, which serves as proof of
possession during commissioning. If not provided to compute a verifier, the
--spake2p-verifier-base64 must be provided.
- --secured-device-port <port>: A 16-bit unsigned integer specifying the
listen port to use for secure device messages (default is 5540).
- --KVS <filepath>: A file to store Key Value Store items.

For a full list, call the generated linux binary with

- -h, --help: Print this output and then exit.

## CI

All CI jobs for chef can be found in `.github/workflows/chef.yaml`.
Expand Down
5 changes: 5 additions & 0 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,11 @@ def main() -> int:
'chip_shell_cmd_server = false',
'chip_build_libshell = true',
'chip_config_network_layer_ble = false',
'chip_device_project_config_include = "<CHIPProjectAppConfig.h>"',
'chip_project_config_include = "<CHIPProjectAppConfig.h>"',
'chip_system_project_config_include = "<SystemProjectConfig.h>"',
'chip_project_config_include_dirs = [ "${chip_root}/examples/chef/linux/include" ]',
'chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]',
(f'target_defines = ["CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID={options.vid}", '
f'"CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID={options.pid}", '
f'"CONFIG_ENABLE_PW_RPC={int(options.do_rpc)}", '
Expand Down
34 changes: 34 additions & 0 deletions examples/chef/linux/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* Example project configuration file for CHIP.
*
* This is a place to put application or project-specific overrides
* to the default configuration values for general CHIP features.
*
*/

#pragma once

// include the CHIPProjectConfig from config/standalone
#include <CHIPProjectConfig.h>

// Allows app options (ports) to be configured on launch of app
#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1

0 comments on commit 1041752

Please sign in to comment.