Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: chef samples may specify Matter ports #30471

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading