diff --git a/examples/chef/README.md b/examples/chef/README.md index 11a15261b08d97..4e1db9bf7dbff3 100644 --- a/examples/chef/README.md +++ b/examples/chef/README.md @@ -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 : A 12-bit unsigned integer match the value + which a device advertises during commissioning. +- --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 : A 16-bit unsigned integer specifying the + listen port to use for secure device messages (default is 5540). +- --KVS : 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`. diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 4600bc02061e6d..47d3c7ad3d34b7 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -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 = ""', + 'chip_project_config_include = ""', + 'chip_system_project_config_include = ""', + '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)}", ' diff --git a/examples/chef/linux/include/CHIPProjectAppConfig.h b/examples/chef/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..b6c15f4c98230e --- /dev/null +++ b/examples/chef/linux/include/CHIPProjectAppConfig.h @@ -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 + +// Allows app options (ports) to be configured on launch of app +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1