function _get_fullpath() {
    cd "$(dirname "$1")" && echo "$PWD/$(basename "$1")"
}
set -e
[[ "$1" == "--help" ]] && {
    echo "Usage: $0 [ZAP-file-path]" >&2
    exit 0
}
SCRIPT_PATH="$(_get_fullpath "$0")"
CHIP_ROOT="${SCRIPT_PATH%/scripts/tools/zap/run_zaptool.sh}"
[[ -n "$1" ]] && ZAP_ARGS=(-i "$(_get_fullpath "$1")") || ZAP_ARGS=()
(
    cd "$CHIP_ROOT" &&
        git submodule update --init third_party/zap/repo
    cd "third_party/zap/repo"
    if ! npm list installed-check &>/dev/null; then
        npm install installed-check
    fi
    if ! ./node_modules/.bin/installed-check -c &>/dev/null; then
        npm install
    fi
    echo "ARGS: ${ZAP_ARGS[@]}"
    if [[ "${ZAP_ARGS[@]}" == *"/all-clusters-app.zap"* ]]; then
        ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl-with-test-extensions.json"
    else
        ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl.json"
    fi
    node src-script/zap-start.js --logToStdout \
        --gen "$CHIP_ROOT/src/app/zap-templates/app-templates.json" \
        --zcl "$ZCL_FILE" \
        "${ZAP_ARGS[@]}"
)
'Smart Home > MATTER' 카테고리의 다른 글
| run_zaptool.sh 실행 오류 => 해결 (0) | 2022.12.06 | 
|---|---|
| Matter - dns-sd 기반 commissioning (0) | 2022.11.07 | 
| MATTER/Log test7/ app (0) | 2022.10.10 | 
| MATTER/Log test7/ python (0) | 2022.10.10 | 
| MATTER/chip-device-ctrl(python controller) 분석 (0) | 2022.10.10 | 
 
										
									
댓글