esp-idf/components/ieee802154/test_apps/test_ieee802154/pytest_test_ieee802154.py
2022-10-24 16:19:00 +08:00

30 lines
933 B
Python

# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
from typing import Tuple
import pytest
from pytest_embedded_idf.dut import IdfDut
@pytest.mark.esp32h2
@pytest.mark.ieee802154
@pytest.mark.parametrize(
'count, config, beta_target', [
(2, 'release', 'esp32h2beta2'),
], indirect=True
)
def test_based_txrx(dut: Tuple[IdfDut, IdfDut]) -> None:
transmit = dut[0]
receive = dut[1]
receive.expect('ieee802154>', timeout=60)
receive.write('rx -r 1')
receive.expect('RX Start', timeout=60)
transmit.expect('ieee802154>', timeout=60)
transmit.write('tx -l 10')
transmit.expect('Tx Done 10 bytes', timeout=60)
transmit.expect('00 01 02 03 04 05 06 07', timeout=60)
transmit.expect('08 09 00 00 00 00 00 00', timeout=60)
receive.expect('Rx Done 10 bytes', timeout=60)
receive.expect('00 01 02 03 04 05 06 07', timeout=60)