[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
+7 -3
View File
@@ -48,7 +48,7 @@ at_exit() {
build() {
make -f examples/Makefile-simulation
make -f src/posix/Makefile-posix PLATFORM_NETIF=1 PLATFORM_UDP=1 UDP_FORWARD=0
make -f src/posix/Makefile-posix PLATFORM_NETIF=1 PLATFORM_UDP=1 UDP_FORWARD=0 MAX_POWER_TABLE=1
}
check() {
@@ -75,12 +75,16 @@ check() {
# Cover setting a valid network interface name.
readonly VALID_NETIF_NAME="wan$(date +%H%M%S)"
local options=(
'--max-power-table=11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26'
)
if [[ "${DAEMON}" = 1 ]]; then
sudo "$(pwd)/$(ls output/posix/*linux*/bin/ot-daemon)" -I "${VALID_NETIF_NAME}" ${CORE_PTY} &
sudo "$(pwd)/$(ls output/posix/*linux*/bin/ot-daemon)" "${options[@]}" -I "${VALID_NETIF_NAME}" ${CORE_PTY} &
sleep 1
OT_CLI_CMD="$(pwd)/$(ls output/posix/*linux*/bin/ot-ctl)"
else
OT_CLI_CMD="$(pwd)/$(ls output/posix/*linux*/bin/ot-cli) ${CORE_PTY}"
OT_CLI_CMD="$(pwd)/$(ls output/posix/*linux*/bin/ot-cli) "${options[@]}" ${CORE_PTY}"
fi
sudo ${OT_CLI_CMD} -I "${VALID_NETIF_NAME}" -n