[posix] add argument to set max power table (#4878)

This commit adds a max power table for POSIX platform, which can
customize the max allowed transmit power of each channel with the
command line argument --max-power-table.
This commit is contained in:
Yakun Xu
2020-04-30 14:23:16 -07:00
committed by GitHub
parent c4b098f0d3
commit 7b0cb98445
16 changed files with 273 additions and 10 deletions
+9 -3
View File
@@ -122,6 +122,7 @@ build_posix()
options+=(
"-DOT_PLATFORM=posix"
"-DOT_POSIX_MAX_POWER_TABLE=ON"
"-DOT_READLINE=readline"
"-DOT_THREAD_VERSION=${version}"
)
@@ -250,16 +251,21 @@ do_cert_suite() {
do_expect()
{
local ot_command
local rcp_command=
local test_pattern
if [[ "${NODE_MODE}" == rcp ]]; then
ot_command="${OT_CLI_PATH} ${RADIO_DEVICE}"
ot_command="${OT_CLI_PATH}"
rcp_command="${RADIO_DEVICE}"
test_pattern='posix-*.exp'
else
ot_command="${OT_BUILDDIR}/cmake/openthread-simulation-${THREAD_VERSION}/examples/apps/cli/ot-cli-ftd"
test_pattern='cli-*.exp'
fi
while read -r script; do
rm -rf tmp
OT_COMMAND="${ot_command}" "${script}" || {
OT_COMMAND="${ot_command}" RCP_COMMAND="${rcp_command}" "${script}" || {
local exit_code=$?
echo -e "${COLOR_FAIL}FAIL${COLOR_NONE} ${script}"
exit "${exit_code}"
@@ -269,7 +275,7 @@ do_expect()
if [[ $# != 0 ]]; then
for script in "$@"; do echo ${script}; done
else
find tests/scripts/expect -type f -executable
find tests/scripts/expect -type f -executable -name "${test_pattern}"
fi
)