diff --git a/components/ieee802154/test_apps/test_ieee802154/pytest_test_ieee802154.py b/components/ieee802154/test_apps/test_ieee802154/pytest_test_ieee802154.py index bb7a789c49..0073fb881f 100644 --- a/components/ieee802154/test_apps/test_ieee802154/pytest_test_ieee802154.py +++ b/components/ieee802154/test_apps/test_ieee802154/pytest_test_ieee802154.py @@ -46,9 +46,9 @@ def dlt_pendingtable(ser:IdfDut, addr:str) -> None: cmd = cmd + '\n' ser.write(cmd) if len(addr_list) == 2: - ser.expect('delete pending shortaddr: {}'.format(addr_field), timeout=1) + ser.expect('delete pending shortaddr: {}'.format(addr_field), timeout=10) else: - ser.expect('delete pending extaddr: {}'.format(addr_field), timeout=1) + ser.expect('delete pending extaddr: {}'.format(addr_field), timeout=10) sleep(0.1) @@ -60,9 +60,9 @@ def add_pendingtable(ser:IdfDut, addr:str='') -> None: addr_field = addr_field.lower() ser.write(cmd) if len(addr.split(' ')) == 2: - ser.expect('add pending shortaddr: {}'.format(addr_field), timeout=1) + ser.expect('add pending shortaddr: {}'.format(addr_field), timeout=10) else: - ser.expect('add pending extaddr: {}'.format(addr_field), timeout=1) + ser.expect('add pending extaddr: {}'.format(addr_field), timeout=10) sleep(0.1) @@ -120,30 +120,30 @@ def dlt_short_extern_addr_in_pendingtable(ser:IdfDut, table:List, short:int=5, e def test_based_txrx(dut: Tuple[IdfDut, IdfDut]) -> None: transmit = dut[0] receive = dut[1] - receive.expect('ieee802154>', timeout=1) + receive.expect('ieee802154>', timeout=10) transmit.write('channel -s 23') - transmit.expect('set channel: 23', timeout=1) + transmit.expect('set channel: 23', timeout=10) receive.write('channel -s 23') - receive.expect('set channel: 23', timeout=1) + receive.expect('set channel: 23', timeout=10) receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) - transmit.expect('ieee802154>', timeout=1) + receive.expect('RX Start', timeout=10) + transmit.expect('ieee802154>', timeout=10) transmit.write('tx -l 10') - transmit.expect('tx sfd done, Radio state: 3', timeout=1) - transmit.expect('Tx Done 10 bytes', timeout=1) - transmit.expect('00 01 02 03 04 05 06 07', timeout=1) - transmit.expect('08 09 00 00 00 00 00 00', timeout=1) - receive.expect('rx sfd done, Radio state: 2', timeout=1) - receive.expect('Rx Done 10 bytes', timeout=1) - receive.expect('00 01 02 03 04 05 06 07', timeout=1) + transmit.expect('tx sfd done, Radio state: 3', timeout=10) + transmit.expect('Tx Done 10 bytes', timeout=10) + transmit.expect('00 01 02 03 04 05 06 07', timeout=10) + transmit.expect('08 09 00 00 00 00 00 00', timeout=10) + receive.expect('rx sfd done, Radio state: 2', timeout=10) + receive.expect('Rx Done 10 bytes', timeout=10) + receive.expect('00 01 02 03 04 05 06 07', timeout=10) receive.write('rx -r 0') - receive.expect('radio exit receive mode', timeout=1) + receive.expect('radio exit receive mode', timeout=10) transmit.write('tx -l 10') - transmit.expect('tx sfd done, Radio state: 3', timeout=1) - transmit.expect('Tx Done 10 bytes', timeout=1) - transmit.expect('00 01 02 03 04 05 06 07', timeout=1) - transmit.expect('08 09 00 00 00 00 00 00', timeout=1) - tmp = receive.expect(pexpect.TIMEOUT, timeout=5) + transmit.expect('tx sfd done, Radio state: 3', timeout=10) + transmit.expect('Tx Done 10 bytes', timeout=10) + transmit.expect('00 01 02 03 04 05 06 07', timeout=10) + transmit.expect('08 09 00 00 00 00 00 00', timeout=10) + tmp = receive.expect(pexpect.TIMEOUT, timeout=10) assert 'Rx Done' not in str(tmp) @@ -155,10 +155,10 @@ def test_based_txrx(dut: Tuple[IdfDut, IdfDut]) -> None: ) def test_based_energy(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('ed -d 8') - transmit.expect('ed start', timeout=1) - transmit.expect('ed_scan_rss_value:', timeout=1) + transmit.expect('ed start', timeout=10) + transmit.expect('ed_scan_rss_value:', timeout=10) @pytest.mark.esp32c6 @@ -169,11 +169,11 @@ def test_based_energy(dut: IdfDut) -> None: ) def test_based_channel(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('channel -s 23') - transmit.expect('set channel: 23', timeout=1) + transmit.expect('set channel: 23', timeout=10) transmit.write('channel -g') - transmit.expect('current channel: 23', timeout=1) + transmit.expect('current channel: 23', timeout=10) @pytest.mark.esp32c6 @@ -184,11 +184,11 @@ def test_based_channel(dut: IdfDut) -> None: ) def test_based_txpower(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('txpower -s 13') - transmit.expect('set txpower: 13', timeout=1) + transmit.expect('set txpower: 13', timeout=10) transmit.write('txpower -g') - transmit.expect('current txpower: 13', timeout=1) + transmit.expect('current txpower: 13', timeout=10) @pytest.mark.esp32c6 @@ -199,15 +199,15 @@ def test_based_txpower(dut: IdfDut) -> None: ) def test_based_promiscuous(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('promisc -e') - transmit.expect('promiscuous mode is enabled', timeout=1) + transmit.expect('promiscuous mode is enabled', timeout=10) transmit.write('promisc -g') - transmit.expect('hardware promiscuous mode was enabled', timeout=1) + transmit.expect('hardware promiscuous mode was enabled', timeout=10) transmit.write('promisc -d') - transmit.expect('promiscuous mode is disabled', timeout=1) + transmit.expect('promiscuous mode is disabled', timeout=10) transmit.write('promisc -g') - transmit.expect('hardware promiscuous mode was disabled', timeout=1) + transmit.expect('hardware promiscuous mode was disabled', timeout=10) @pytest.mark.esp32c6 @@ -218,11 +218,11 @@ def test_based_promiscuous(dut: IdfDut) -> None: ) def test_based_panid(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('panid 0x60') - transmit.expect('set panid: 0x60', timeout=1) + transmit.expect('set panid: 0x60', timeout=10) transmit.write('panid -g') - transmit.expect('current panid: 0x60', timeout=1) + transmit.expect('current panid: 0x60', timeout=10) @pytest.mark.esp32c6 @@ -233,11 +233,11 @@ def test_based_panid(dut: IdfDut) -> None: ) def test_based_shortaddr(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('shortaddr 0x1234') - transmit.expect('set shortaddr: 0x1234', timeout=1) + transmit.expect('set shortaddr: 0x1234', timeout=10) transmit.write('shortaddr -g') - transmit.expect('current shortaddr: 0x1234', timeout=1) + transmit.expect('current shortaddr: 0x1234', timeout=10) @pytest.mark.esp32c6 @@ -248,11 +248,11 @@ def test_based_shortaddr(dut: IdfDut) -> None: ) def test_based_extaddr(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('extaddr 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08') - transmit.expect('set extaddr: 0807060504030201', timeout=1) + transmit.expect('set extaddr: 0807060504030201', timeout=10) transmit.write('extaddr -g') - transmit.expect('get extaddr: 0807060504030201', timeout=1) + transmit.expect('get extaddr: 0807060504030201', timeout=10) @pytest.mark.esp32c6 @@ -263,15 +263,15 @@ def test_based_extaddr(dut: IdfDut) -> None: ) def test_based_coordinator(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('coordinator -e') - transmit.expect('hardware coordinator is enabled', timeout=1) + transmit.expect('hardware coordinator is enabled', timeout=10) transmit.write('coordinator -g') - transmit.expect('hardware coordinator was enabled', timeout=1) + transmit.expect('hardware coordinator was enabled', timeout=10) transmit.write('coordinator -d') - transmit.expect('hardware coordinator is disabled', timeout=1) + transmit.expect('hardware coordinator is disabled', timeout=10) transmit.write('coordinator -g') - transmit.expect('hardware coordinator was disabled', timeout=1) + transmit.expect('hardware coordinator was disabled', timeout=10) @pytest.mark.esp32c6 @@ -282,17 +282,17 @@ def test_based_coordinator(dut: IdfDut) -> None: ) def test_based_pending(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('pending -m 2') - transmit.expect('set auto pending mode as: 2', timeout=1) + transmit.expect('set auto pending mode as: 2', timeout=10) transmit.write('pending -g') - transmit.expect('get auto pending mode as: 2', timeout=1) + transmit.expect('get auto pending mode as: 2', timeout=10) add_pendingtable(transmit, addr='0x01 0x02') add_pendingtable(transmit, addr='0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08') dlt_pendingtable(transmit, addr='0x22 0x11') dlt_pendingtable(transmit, addr='0x77 0x66 0x55 0x44 0x33 0x22 0x11 0x00') transmit.write('pending -r') - transmit.expect('clear the pending address table', timeout=1) + transmit.expect('clear the pending address table', timeout=10) @pytest.mark.esp32c6 @@ -303,13 +303,13 @@ def test_based_pending(dut: IdfDut) -> None: ) def test_based_cca(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('cca -v -60') - transmit.expect('set cca threshold as: -60', timeout=1) + transmit.expect('set cca threshold as: -60', timeout=10) transmit.write('cca -m 0') - transmit.expect('set cca mode as: 0', timeout=1) + transmit.expect('set cca mode as: 0', timeout=10) transmit.write('cca -g') - transmit.expect('threshold:-60 dB, mode: 0', timeout=1) + transmit.expect('threshold:-60 dB, mode: 0', timeout=10) @pytest.mark.esp32c6 @@ -322,41 +322,41 @@ def test_based_cca(dut: IdfDut) -> None: def test_based_autoack(dut: Tuple[IdfDut, IdfDut]) -> None: transmit = dut[0] receive = dut[1] - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('channel -s 23') - transmit.expect('set channel: 23', timeout=1) - receive.expect('ieee802154>', timeout=1) + transmit.expect('set channel: 23', timeout=10) + receive.expect('ieee802154>', timeout=10) receive.write('channel -s 23') - receive.expect('set channel: 23', timeout=1) + receive.expect('set channel: 23', timeout=10) transmit.write('promisc -d') - transmit.expect('promiscuous mode is disabled', timeout=1) + transmit.expect('promiscuous mode is disabled', timeout=10) receive.write('promisc -d') - receive.expect('promiscuous mode is disabled', timeout=1) + receive.expect('promiscuous mode is disabled', timeout=10) transmit.write('panid 0x280A') - transmit.expect('set panid: 0x280a', timeout=1) + transmit.expect('set panid: 0x280a', timeout=10) transmit.write('shortaddr 0x435A') - transmit.expect('set shortaddr: 0x435a', timeout=1) + transmit.expect('set shortaddr: 0x435a', timeout=10) receive.write('panid 0x94BC') - receive.expect('set panid: 0x94bc', timeout=1) + receive.expect('set panid: 0x94bc', timeout=10) receive.write('shortaddr 0x6FDB') - receive.expect('set shortaddr: 0x6fdb', timeout=1) + receive.expect('set shortaddr: 0x6fdb', timeout=10) receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) + receive.expect('RX Start', timeout=10) transmit.write('tx 0x20 0x88 0x00 0x0A 0x28 0xDB 0x6F 0xBC 0x94 0x5A 0x43 0x68 0x02 0xaa 0x15 0x30 0x01 0x02') - transmit.expect('tx sfd done, Radio state: 3', timeout=1) - transmit.expect('rx sfd done, Radio state: 3', timeout=1) - transmit.expect('Tx Done 18 bytes', timeout=1) - transmit.expect('20 88 00 0a 28 db 6f bc', timeout=1) - transmit.expect('94 5a 43 68 02 aa 15 30', timeout=1) + transmit.expect('tx sfd done, Radio state: 3', timeout=10) + transmit.expect('rx sfd done, Radio state: 3', timeout=10) + transmit.expect('Tx Done 18 bytes', timeout=10) + transmit.expect('20 88 00 0a 28 db 6f bc', timeout=10) + transmit.expect('94 5a 43 68 02 aa 15 30', timeout=10) - receive.expect('rx sfd done, Radio state: 2', timeout=1) - receive.expect('Rx Done 18 bytes', timeout=1) - receive.expect('20 88 00 0a 28 db 6f bc', timeout=1) - receive.expect('94 5a 43 68 02 aa 15 30', timeout=1) + receive.expect('rx sfd done, Radio state: 2', timeout=10) + receive.expect('Rx Done 18 bytes', timeout=10) + receive.expect('20 88 00 0a 28 db 6f bc', timeout=10) + receive.expect('94 5a 43 68 02 aa 15 30', timeout=10) - transmit.expect('Rx ack 5 bytes', timeout=1) - transmit.expect('02 00 00', timeout=1) + transmit.expect('Rx ack 5 bytes', timeout=10) + transmit.expect('02 00 00', timeout=10) @pytest.mark.esp32c6 @@ -371,7 +371,7 @@ def test_based_autopending(dut: Tuple[IdfDut, IdfDut]) -> None: receive = dut[1] # mode 0: CMD ID = 0x04 --> FP = 1 - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('rx -r 0') transmit.expect('radio exit receive mode') transmit.write('channel -s 23') @@ -379,182 +379,182 @@ def test_based_autopending(dut: Tuple[IdfDut, IdfDut]) -> None: transmit.write('promisc -d') transmit.expect('promiscuous mode is disabled') - receive.expect('ieee802154>', timeout=1) + receive.expect('ieee802154>', timeout=10) receive.write('pending -r') - receive.expect('clear the pending address table', timeout=1) + receive.expect('clear the pending address table', timeout=10) receive.write('channel -s 23') - receive.expect('set channel: 23', timeout=1) + receive.expect('set channel: 23', timeout=10) receive.write('promisc -d') - receive.expect('promiscuous mode is disabled', timeout=1) + receive.expect('promiscuous mode is disabled', timeout=10) receive.write('rx -r 0') - receive.expect('radio exit receive mode', timeout=1) + receive.expect('radio exit receive mode', timeout=10) receive.write('pending -m 0') - receive.expect('set auto pending mode as: 0', timeout=1) + receive.expect('set auto pending mode as: 0', timeout=10) receive.write('panid 0x2E74') - receive.expect('set panid: 0x2e74', timeout=1) + receive.expect('set panid: 0x2e74', timeout=10) receive.write('shortaddr 0x2649') - receive.expect('set shortaddr: 0x2649', timeout=1) + receive.expect('set shortaddr: 0x2649', timeout=10) receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) + receive.expect('RX Start', timeout=10) transmit.write('tx 0x23 0x08 0x00 0x74 0x2E 0x49 0x26 0x04 0x53 0x04 0xe3 0x71 0xc2 0x36 0xf7 0xa5 0x2b 0x68 0x79 0x8c 0x72 0x50 0x8b 0x61 0x55 0x56') - transmit.expect('Rx ack 5 bytes', timeout=1) - transmit.expect('12 00 00', timeout=1) + transmit.expect('Rx ack 5 bytes', timeout=10) + transmit.expect('12 00 00', timeout=10) # mode 0: CMD ID != 0x04 --> FP = 0 receive.write('pending -r') - receive.expect('clear the pending address table', timeout=1) + receive.expect('clear the pending address table', timeout=10) receive.write('promisc -d') - receive.expect('promiscuous mode is disabled', timeout=1) + receive.expect('promiscuous mode is disabled', timeout=10) transmit.write('rx -r 0') - transmit.expect('radio exit receive mode', timeout=1) + transmit.expect('radio exit receive mode', timeout=10) transmit.write('promisc -d') - transmit.expect('promiscuous mode is disabled', timeout=1) + transmit.expect('promiscuous mode is disabled', timeout=10) receive.write('rx -r 0') - receive.expect('radio exit receive mode', timeout=1) + receive.expect('radio exit receive mode', timeout=10) receive.write('pending -m 0') - receive.expect('set auto pending mode as: 0', timeout=1) + receive.expect('set auto pending mode as: 0', timeout=10) receive.write('panid 0x3E66') - receive.expect('set panid: 0x3e66', timeout=1) + receive.expect('set panid: 0x3e66', timeout=10) receive.write('shortaddr 0x3970') - receive.expect('set shortaddr: 0x3970', timeout=1) + receive.expect('set shortaddr: 0x3970', timeout=10) receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) + receive.expect('RX Start', timeout=10) transmit.write('tx 0x23 0x08 0x0c 0x66 0x3E 0x70 0x39 0x01 0xef 0x2e 0x9f 0xf3 0xfe 0x75 0x99 0x35 0x66 0xd3') - transmit.expect('Rx ack 5 bytes', timeout=1) - transmit.expect('02 00 0c', timeout=1) + transmit.expect('Rx ack 5 bytes', timeout=10) + transmit.expect('02 00 0c', timeout=10) # mode 1: CMD ID = 0x04, src addr in pending table --> FP = 1 receive.write('pending -r') - receive.expect('clear the pending address table', timeout=1) + receive.expect('clear the pending address table', timeout=10) receive.write('promisc -d') - receive.expect('promiscuous mode is disabled', timeout=1) + receive.expect('promiscuous mode is disabled', timeout=10) receive.write('rx -r 0') - receive.expect('radio exit receive mode', timeout=1) + receive.expect('radio exit receive mode', timeout=10) receive.write('pending -m 1') - receive.expect('set auto pending mode as: 1', timeout=1) + receive.expect('set auto pending mode as: 1', timeout=10) receive.write('panid 0x2D9B') - receive.expect('set panid: 0x2d9b', timeout=1) + receive.expect('set panid: 0x2d9b', timeout=10) receive.write('shortaddr 0x3B21') - receive.expect('set shortaddr: 0x3b21', timeout=1) + receive.expect('set shortaddr: 0x3b21', timeout=10) transmit.write('rx -r 0') - transmit.expect('radio exit receive mode', timeout=1) + transmit.expect('radio exit receive mode', timeout=10) transmit.write('promisc -d') - transmit.expect('promiscuous mode is disabled', timeout=1) + transmit.expect('promiscuous mode is disabled', timeout=10) transmit.write('panid 0xD9C3') - transmit.expect('set panid: 0xd9c3', timeout=1) + transmit.expect('set panid: 0xd9c3', timeout=10) transmit.write('shortaddr 0x93EE') - transmit.expect('set shortaddr: 0x93ee', timeout=1) + transmit.expect('set shortaddr: 0x93ee', timeout=10) wrong_table = set_mismatch_short_extern_addr_pendingtable(receive, '0xEE 0x93') dlt_short_extern_addr_in_pendingtable(receive, wrong_table) add_pendingtable(receive, '0xEE 0x93') receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) + receive.expect('RX Start', timeout=10) transmit.write('tx 0x23 0x88 0x00 0x9B 0x2D 0x21 0x3B 0xC3 0xD9 0xEE 0x93 0x04 0xc8 0x05 0xf8 0x1d 0x6e 0xe3') - transmit.expect('Rx ack 5 bytes', timeout=1) - transmit.expect('12 00 00', timeout=1) + transmit.expect('Rx ack 5 bytes', timeout=10) + transmit.expect('12 00 00', timeout=10) # mode 1: CMD ID = 0x04, src addr not in pending table --> FP = 0 receive.write('pending -r') - receive.expect('clear the pending address table', timeout=1) + receive.expect('clear the pending address table', timeout=10) receive.write('promisc -d') - receive.expect('promiscuous mode is disabled', timeout=1) + receive.expect('promiscuous mode is disabled', timeout=10) receive.write('rx -r 0') - receive.expect('radio exit receive mode', timeout=1) + receive.expect('radio exit receive mode', timeout=10) receive.write('pending -m 1') - receive.expect('set auto pending mode as: 1', timeout=1) + receive.expect('set auto pending mode as: 1', timeout=10) receive.write('panid 0x9FE3') - receive.expect('set panid: 0x9fe3', timeout=1) + receive.expect('set panid: 0x9fe3', timeout=10) receive.write('shortaddr 0x9E20') - receive.expect('set shortaddr: 0x9e20', timeout=1) + receive.expect('set shortaddr: 0x9e20', timeout=10) transmit.write('rx -r 0') - transmit.expect('radio exit receive mode', timeout=1) + transmit.expect('radio exit receive mode', timeout=10) transmit.write('promisc -d') - transmit.expect('promiscuous mode is disabled', timeout=1) + transmit.expect('promiscuous mode is disabled', timeout=10) transmit.write('panid 0xE718') - transmit.expect('set panid: 0xe718', timeout=1) + transmit.expect('set panid: 0xe718', timeout=10) transmit.write('shortaddr 0xC466') - transmit.expect('set shortaddr: 0xc466', timeout=1) + transmit.expect('set shortaddr: 0xc466', timeout=10) wrong_table = set_mismatch_short_extern_addr_pendingtable(receive, '0x66 0xC4') dlt_short_extern_addr_in_pendingtable(receive, wrong_table) receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) + receive.expect('RX Start', timeout=10) transmit.write('tx 0x2b 0x88 0x08 0xE3 0x9F 0x20 0x9E 0x18 0xE7 0x66 0xC4 0x17 0x92 0x8a 0xcd 0x4c 0xd0 0x20 0x40 0x0d 0x46 0x04 0xa0 0xe3 0x9c 0x57') - transmit.expect('Rx ack 5 bytes', timeout=1) - transmit.expect('02 00 08', timeout=1) + transmit.expect('Rx ack 5 bytes', timeout=10) + transmit.expect('02 00 08', timeout=10) # mode 2: frame type is data, src addr in pending table --> FP = 1 receive.write('pending -r') - receive.expect('clear the pending address table', timeout=1) + receive.expect('clear the pending address table', timeout=10) receive.write('promisc -d') - receive.expect('promiscuous mode is disabled', timeout=1) + receive.expect('promiscuous mode is disabled', timeout=10) receive.write('rx -r 0') - receive.expect('radio exit receive mode', timeout=1) + receive.expect('radio exit receive mode', timeout=10) receive.write('pending -m 2') - receive.expect('set auto pending mode as: 2', timeout=1) + receive.expect('set auto pending mode as: 2', timeout=10) receive.write('panid 0xA116') - receive.expect('set panid: 0xa116', timeout=1) + receive.expect('set panid: 0xa116', timeout=10) receive.write('shortaddr 0x939C') - receive.expect('set shortaddr: 0x939c', timeout=1) + receive.expect('set shortaddr: 0x939c', timeout=10) transmit.write('rx -r 0') - transmit.expect('radio exit receive mode', timeout=1) + transmit.expect('radio exit receive mode', timeout=10) transmit.write('promisc -d') - transmit.expect('promiscuous mode is disabled', timeout=1) + transmit.expect('promiscuous mode is disabled', timeout=10) transmit.write('panid 0x9B0B') - transmit.expect('set panid: 0x9b0b', timeout=1) + transmit.expect('set panid: 0x9b0b', timeout=10) transmit.write('shortaddr 0x04E4') - transmit.expect('set shortaddr: 0x4e4', timeout=1) + transmit.expect('set shortaddr: 0x4e4', timeout=10) wrong_table = set_mismatch_short_extern_addr_pendingtable(receive, '0xE4 0x04') dlt_short_extern_addr_in_pendingtable(receive, wrong_table) add_pendingtable(receive, '0xE4 0x04') receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) + receive.expect('RX Start', timeout=10) transmit.write('tx 0x21 0x88 0x10 0x16 0xA1 0x9C 0x93 0x0B 0x9B 0xE4 0x04 0xb8 0xc5 0x63 0x43 0xa7 0x81 0xaf') - transmit.expect('Rx ack 5 bytes', timeout=1) - transmit.expect('12 00 10', timeout=1) + transmit.expect('Rx ack 5 bytes', timeout=10) + transmit.expect('12 00 10', timeout=10) # mode 2: frame type is data, src addr not in pending table --> FP = 0 receive.write('pending -r') - receive.expect('clear the pending address table', timeout=1) + receive.expect('clear the pending address table', timeout=10) receive.write('promisc -d') - receive.expect('promiscuous mode is disabled', timeout=1) + receive.expect('promiscuous mode is disabled', timeout=10) receive.write('rx -r 0') - receive.expect('radio exit receive mode', timeout=1) + receive.expect('radio exit receive mode', timeout=10) receive.write('pending -m 2') - receive.expect('set auto pending mode as: 2', timeout=1) + receive.expect('set auto pending mode as: 2', timeout=10) receive.write('panid 0xE0C9') - receive.expect('set panid: 0xe0c9', timeout=1) + receive.expect('set panid: 0xe0c9', timeout=10) receive.write('shortaddr 0x3325') - receive.expect('set shortaddr: 0x3325', timeout=1) + receive.expect('set shortaddr: 0x3325', timeout=10) transmit.write('rx -r 0') - transmit.expect('radio exit receive mode', timeout=1) + transmit.expect('radio exit receive mode', timeout=10) transmit.write('promisc -d') - transmit.expect('promiscuous mode is disabled', timeout=1) + transmit.expect('promiscuous mode is disabled', timeout=10) transmit.write('panid 0x844F') - transmit.expect('set panid: 0x844f', timeout=1) + transmit.expect('set panid: 0x844f', timeout=10) transmit.write('shortaddr 0x7C4C') - transmit.expect('set shortaddr: 0x7c4c', timeout=1) + transmit.expect('set shortaddr: 0x7c4c', timeout=10) wrong_table = set_mismatch_short_extern_addr_pendingtable(receive, '0x4C 0x7C') dlt_short_extern_addr_in_pendingtable(receive, wrong_table) receive.write('rx -r 1') - receive.expect('RX Start', timeout=1) + receive.expect('RX Start', timeout=10) transmit.write('tx 0x21 0x88 0x10 0xC9 0xE0 0x25 0x33 0x4F 0x84 0x4C 0x7C 0xa8 0xff 0x51 0x72 0xef 0xc1 0xbb') - transmit.expect('Rx ack 5 bytes', timeout=1) - transmit.expect('02 00 10', timeout=1) + transmit.expect('Rx ack 5 bytes', timeout=10) + transmit.expect('02 00 10', timeout=10) @pytest.mark.esp32c6 @@ -565,18 +565,18 @@ def test_based_autopending(dut: Tuple[IdfDut, IdfDut]) -> None: ) def test_based_transmit_failed(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('channel -s 23') - transmit.expect('set channel: 23', timeout=1) + transmit.expect('set channel: 23', timeout=10) transmit.write('cca -v -120') - transmit.expect('set cca threshold as: -120', timeout=1) + transmit.expect('set cca threshold as: -120', timeout=10) transmit.write('tx -l 10 -C') - transmit.expect('the Frame Transmission failed, Failure reason: 1', timeout=1) + transmit.expect('the Frame Transmission failed, Failure reason: 1', timeout=10) transmit.write('tx -l 10') - transmit.expect('tx sfd done, Radio state: 3', timeout=1) - transmit.expect('Tx Done 10 bytes', timeout=1) - transmit.expect('00 01 02 03 04 05 06 07', timeout=1) - transmit.expect('08 09 00 00 00 00 00 00', timeout=1) + transmit.expect('tx sfd done, Radio state: 3', timeout=10) + transmit.expect('Tx Done 10 bytes', timeout=10) + transmit.expect('00 01 02 03 04 05 06 07', timeout=10) + transmit.expect('08 09 00 00 00 00 00 00', timeout=10) @pytest.mark.esp32c6 @@ -587,16 +587,16 @@ def test_based_transmit_failed(dut: IdfDut) -> None: ) def test_based_initialize(dut: IdfDut) -> None: transmit = dut - transmit.expect('ieee802154>', timeout=1) + transmit.expect('ieee802154>', timeout=10) transmit.write('fheap') - fst_data = transmit.expect(r'heap size: [0-9]+', timeout=1)[0].decode() + fst_data = transmit.expect(r'heap size: [0-9]+', timeout=10)[0].decode() fst_size = re.findall(r'heap size: ([0-9]+)', fst_data) transmit.write('esp154 -e') - transmit.expect('initialize the IEEE 802.15.4 subsystem', timeout=1) + transmit.expect('initialize the IEEE 802.15.4 subsystem', timeout=10) transmit.write('esp154 -d') - transmit.expect('deinitialize the IEEE 802.15.4 subsystem', timeout=1) + transmit.expect('deinitialize the IEEE 802.15.4 subsystem', timeout=10) transmit.write('fheap') - scd_data = transmit.expect(r'heap size: [0-9]+', timeout=1)[0].decode() + scd_data = transmit.expect(r'heap size: [0-9]+', timeout=10)[0].decode() scd_size = re.findall(r'heap size: ([0-9]+)', scd_data) print('first heap size: ', int(fst_size[0])) print('second heap size: ', int(scd_size[0])) diff --git a/components/openthread/CMakeLists.txt b/components/openthread/CMakeLists.txt index 53eb0e6078..7a40455ca5 100644 --- a/components/openthread/CMakeLists.txt +++ b/components/openthread/CMakeLists.txt @@ -67,6 +67,7 @@ if(CONFIG_OPENTHREAD_ENABLED) "openthread/src/core/api/icmp6_api.cpp" "openthread/src/core/api/ip6_api.cpp" "openthread/src/core/api/link_api.cpp" + "openthread/src/core/api/link_metrics_api.cpp" "openthread/src/core/api/message_api.cpp" "openthread/src/core/api/nat64_api.cpp" "openthread/src/core/api/netdata_api.cpp" @@ -91,6 +92,7 @@ if(CONFIG_OPENTHREAD_ENABLED) "openthread/src/core/thread/discover_scanner.cpp" "openthread/src/core/thread/energy_scan_server.cpp" "openthread/src/core/thread/key_manager.cpp" + "openthread/src/core/thread/link_metrics.cpp" "openthread/src/core/thread/lowpan.cpp" "openthread/src/core/thread/mesh_forwarder.cpp" "openthread/src/core/thread/mesh_forwarder_ftd.cpp" diff --git a/components/openthread/port/esp_openthread_alarm.c b/components/openthread/port/esp_openthread_alarm.c index 92596dcc96..f1e4a52d12 100644 --- a/components/openthread/port/esp_openthread_alarm.c +++ b/components/openthread/port/esp_openthread_alarm.c @@ -41,12 +41,7 @@ static inline uint32_t calculate_duration(uint32_t target, uint32_t now) uint64_t otPlatTimeGet(void) { - struct timeval tv_now; - - int err = gettimeofday(&tv_now, NULL); - assert(err == 0); - - return (uint64_t)tv_now.tv_sec * US_PER_S + tv_now.tv_usec; + return (uint64_t)esp_timer_get_time(); } void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt) @@ -68,7 +63,7 @@ void otPlatAlarmMilliStop(otInstance *aInstance) uint32_t inline otPlatAlarmMilliGetNow(void) { - return esp_timer_get_time() / US_PER_MS; + return otPlatTimeGet() / US_PER_MS; } void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt) @@ -89,7 +84,7 @@ void otPlatAlarmMicroStop(otInstance *aInstance) uint32_t inline otPlatAlarmMicroGetNow(void) { - return esp_timer_get_time(); + return otPlatTimeGet(); } esp_err_t esp_openthread_alarm_init(void) diff --git a/components/openthread/port/esp_openthread_lock.c b/components/openthread/port/esp_openthread_lock.c index 6994d62115..ba7c63d411 100644 --- a/components/openthread/port/esp_openthread_lock.c +++ b/components/openthread/port/esp_openthread_lock.c @@ -5,8 +5,11 @@ */ #include "esp_openthread_lock.h" +#include "esp_openthread_common_macro.h" +#include "esp_check.h" #include "esp_err.h" +#include "esp_log.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" @@ -15,6 +18,8 @@ static SemaphoreHandle_t s_openthread_mutex = NULL; bool esp_openthread_lock_acquire(TickType_t block_ticks) { + ESP_RETURN_ON_FALSE(s_openthread_mutex && s_openthread_task_mutex, false, OT_PLAT_LOG_TAG, + "Failed to acquire the lock because the mutex is not ready"); BaseType_t ret = xSemaphoreTakeRecursive(s_openthread_mutex, block_ticks) && xSemaphoreTakeRecursive(s_openthread_task_mutex, block_ticks); return (ret == pdTRUE); @@ -22,18 +27,24 @@ bool esp_openthread_lock_acquire(TickType_t block_ticks) void esp_openthread_lock_release(void) { + ESP_RETURN_ON_FALSE(s_openthread_mutex && s_openthread_task_mutex, , OT_PLAT_LOG_TAG, + "Failed to release the lock because the mutex is not ready"); xSemaphoreGiveRecursive(s_openthread_task_mutex); xSemaphoreGiveRecursive(s_openthread_mutex); } bool esp_openthread_task_switching_lock_acquire(TickType_t block_ticks) { + ESP_RETURN_ON_FALSE(s_openthread_task_mutex, false, OT_PLAT_LOG_TAG, + "Failed to acquire the lock because the mutex is not ready"); BaseType_t ret = xSemaphoreTakeRecursive(s_openthread_task_mutex, block_ticks); return (ret == pdTRUE); } void esp_openthread_task_switching_lock_release(void) { + ESP_RETURN_ON_FALSE(s_openthread_task_mutex, , OT_PLAT_LOG_TAG, + "Failed to release the lock because the mutex is not ready"); xSemaphoreGiveRecursive(s_openthread_task_mutex); } diff --git a/components/openthread/port/esp_openthread_netif_glue.c b/components/openthread/port/esp_openthread_netif_glue.c index b7c0a6ba64..9be2b6b947 100644 --- a/components/openthread/port/esp_openthread_netif_glue.c +++ b/components/openthread/port/esp_openthread_netif_glue.c @@ -68,9 +68,9 @@ static bool is_addr_locator(const otIp6Address *address) return address->mFields.m32[2] == 0xff000000 && address->mFields.m16[6] == 0xfe; } -static bool is_openthread_internal_mesh_local_addr(const otIp6AddressInfo *address_info) +bool is_openthread_internal_mesh_local_addr(const otIp6Address *address) { - return is_addr_locator(address_info->mAddress) && is_mesh_local_addr(address_info->mAddress); + return is_addr_locator(address) && is_mesh_local_addr(address); } static esp_err_t notify_packets_pending(void) @@ -89,7 +89,7 @@ static void process_thread_address(const otIp6AddressInfo *address_info, bool is bool is_multicast = address_info->mAddress->mFields.m8[0] == 0xff; esp_ip6_addr_t addr; - if (is_openthread_internal_mesh_local_addr(address_info)) { + if (is_openthread_internal_mesh_local_addr(address_info->mAddress)) { return; } diff --git a/components/openthread/port/esp_openthread_radio.c b/components/openthread/port/esp_openthread_radio.c index 5dd4161954..5d777d20e0 100644 --- a/components/openthread/port/esp_openthread_radio.c +++ b/components/openthread/port/esp_openthread_radio.c @@ -25,6 +25,7 @@ #include "openthread/link.h" #include "openthread/platform/diag.h" #include "openthread/platform/radio.h" +#include "openthread/platform/time.h" #include "utils/link_metrics.h" #include "utils/mac_frame.h" @@ -493,7 +494,7 @@ void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCoun uint64_t otPlatRadioGetNow(otInstance *aInstance) { OT_UNUSED_VARIABLE(aInstance); - return esp_timer_get_time(); + return otPlatTimeGet(); } #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE @@ -505,7 +506,7 @@ void otPlatRadioUpdateCslSampleTime(otInstance *aInstance, uint32_t aCslSampleTi static IRAM_ATTR uint16_t get_csl_phase() { - uint32_t cur_time = esp_timer_get_time(); + uint32_t cur_time = otPlatTimeGet(); uint32_t csl_period_us = s_csl_period * OT_US_PER_TEN_SYMBOLS; uint32_t diff = (csl_period_us - (cur_time % csl_period_us) + (s_csl_sample_time % csl_period_us)) % csl_period_us; @@ -578,7 +579,7 @@ static void IRAM_ATTR convert_to_ot_frame(uint8_t *data, esp_ieee802154_frame_in radio_frame->mInfo.mRxInfo.mRssi = frame_info->rssi; radio_frame->mInfo.mRxInfo.mLqi = frame_info->lqi; radio_frame->mInfo.mRxInfo.mAckedWithFramePending = frame_info->pending; - radio_frame->mInfo.mRxInfo.mTimestamp = esp_timer_get_time(); + radio_frame->mInfo.mRxInfo.mTimestamp = otPlatTimeGet(); #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE radio_frame->mInfo.mRxInfo.mTimestamp = frame_info->timestamp; @@ -672,6 +673,8 @@ void IRAM_ATTR esp_ieee802154_receive_done(uint8_t *data, esp_ieee802154_frame_i s_receive_frame[s_recv_queue.tail].mInfo.mRxInfo.mAckedWithSecEnhAck = s_with_security_enh_ack; s_receive_frame[s_recv_queue.tail].mInfo.mRxInfo.mAckFrameCounter = s_ack_frame_counter; s_receive_frame[s_recv_queue.tail].mInfo.mRxInfo.mAckKeyId = s_ack_key_id; + } else { + s_receive_frame[s_recv_queue.tail].mInfo.mRxInfo.mAckedWithSecEnhAck = false; } s_with_security_enh_ack = false; #endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 diff --git a/components/openthread/port/esp_openthread_radio_spinel.cpp b/components/openthread/port/esp_openthread_radio_spinel.cpp index 392aee4307..1ea69d5867 100644 --- a/components/openthread/port/esp_openthread_radio_spinel.cpp +++ b/components/openthread/port/esp_openthread_radio_spinel.cpp @@ -321,3 +321,32 @@ const char *otPlatRadioGetVersionString(otInstance *aInstance) } #endif // OPENTHREAD_CONFIG_DIAG_ENABLE + +uint64_t otPlatRadioGetNow(otInstance *aInstance) +{ + OT_UNUSED_VARIABLE(aInstance); + return s_radio.GetNow(); +} + +#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE +uint8_t otPlatRadioGetCslAccuracy(otInstance *aInstance) +{ + OT_UNUSED_VARIABLE(aInstance); + return s_radio.GetCslAccuracy(); + +} + +uint8_t otPlatRadioGetCslUncertainty(otInstance *aInstance) +{ + OT_UNUSED_VARIABLE(aInstance); + return s_radio.GetCslUncertainty(); +} +#endif + +#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +otError otPlatRadioConfigureEnhAckProbing(otInstance *aInstance, otLinkMetrics aLinkMetrics, const otShortAddress aShortAddress, const otExtAddress *aExtAddress) +{ + OT_UNUSED_VARIABLE(aInstance); + return s_radio.ConfigureEnhAckProbing(aLinkMetrics, aShortAddress, *aExtAddress); +} +#endif diff --git a/components/openthread/port/esp_openthread_udp.c b/components/openthread/port/esp_openthread_udp.c index 325d22b48e..17f8256a38 100644 --- a/components/openthread/port/esp_openthread_udp.c +++ b/components/openthread/port/esp_openthread_udp.c @@ -16,6 +16,7 @@ #include "esp_openthread_common_macro.h" #include "esp_openthread_lock.h" #include "esp_openthread_netif_glue.h" +#include "esp_openthread_netif_glue_priv.h" #include "esp_openthread_task_queue.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -322,6 +323,7 @@ static bool is_multicast(const otIp6Address *address) static void udp_send_task(void *ctx) { + err_t err = ERR_OK; udp_send_task_t *task = (udp_send_task_t *)ctx; struct pbuf *send_buf = NULL; uint16_t len = otMessageGetLength(task->message); @@ -349,14 +351,24 @@ static void udp_send_task(void *ctx) task->pcb->flags |= UDP_FLAGS_MULTICAST_LOOP; } send_buf = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); - otMessageRead(task->message, 0, send_buf->payload, len); VerifyOrExit(send_buf != NULL); - udp_sendto(task->pcb, send_buf, &task->peer_addr, task->peer_port); + otMessageRead(task->message, 0, send_buf->payload, len); + + if (task->netif_index == get_netif_index(OT_NETIF_THREAD)) { + // If the input arguments indicated the netif is OT, directly send the message. + err = udp_sendto_if_src(task->pcb, send_buf, &task->peer_addr, task->peer_port, netif_get_by_index(task->netif_index), &task->source_addr); + } else { + // Otherwise, let Lwip to determine which netif will be used. + err = udp_sendto(task->pcb, send_buf, &task->peer_addr, task->peer_port); + } exit: if (send_buf) { pbuf_free(send_buf); } + if (err != ERR_OK) { + ESP_LOGE(OT_PLAT_LOG_TAG, "Failed to Send UDP message, err: %d", err); + } esp_openthread_task_switching_lock_acquire(portMAX_DELAY); otMessageFree(task->message); esp_openthread_task_switching_lock_release(); @@ -376,7 +388,6 @@ otError otPlatUdpSend(otUdpSocket *udp_socket, otMessage *message, const otMessa { udp_send_task_t *task = (udp_send_task_t *)malloc(sizeof(udp_send_task_t)); otError error = OT_ERROR_NONE; - VerifyOrExit(task != NULL, error = OT_ERROR_NO_BUFS); task->pcb = (struct udp_pcb *)udp_socket->mHandle; task->message = message; @@ -396,6 +407,11 @@ otError otPlatUdpSend(otUdpSocket *udp_socket, otMessage *message, const otMessa if (is_link_local(&message_info->mPeerAddr) || is_multicast(&message_info->mPeerAddr)) { task->netif_index = get_netif_index(message_info->mIsHostInterface ? OT_NETIF_BACKBONE : OT_NETIF_THREAD); } + + if (is_openthread_internal_mesh_local_addr(&message_info->mPeerAddr)) { + // If the destination address is a openthread mesh local address, set the netif OT. + task->netif_index = get_netif_index(OT_NETIF_THREAD); + } tcpip_callback(udp_send_task, task); exit: @@ -425,9 +441,10 @@ otError otPlatUdpJoinMulticastGroup(otUdpSocket *socket, otNetifIdentifier netif otError error = OT_ERROR_NONE; VerifyOrExit(task != NULL, error = OT_ERROR_NO_BUFS); - memcpy(task->addr.addr, addr->mFields.m8, sizeof(task->addr.addr)); task->is_join = true; task->netif_index = get_netif_index(netif_id); + task->addr.zone = task->netif_index; + memcpy(task->addr.addr, addr->mFields.m8, sizeof(task->addr.addr)); tcpip_callback(udp_multicast_join_leave_task, task); exit: @@ -441,9 +458,10 @@ otError otPlatUdpLeaveMulticastGroup(otUdpSocket *socket, otNetifIdentifier neti otError error = OT_ERROR_NONE; VerifyOrExit(task != NULL, error = OT_ERROR_NO_BUFS); - memcpy(task->addr.addr, addr->mFields.m8, sizeof(task->addr.addr)); task->is_join = false; task->netif_index = get_netif_index(netif_id); + task->addr.zone = task->netif_index; + memcpy(task->addr.addr, addr->mFields.m8, sizeof(task->addr.addr)); tcpip_callback(udp_multicast_join_leave_task, task); exit: diff --git a/components/openthread/port/esp_spi_spinel_interface.cpp b/components/openthread/port/esp_spi_spinel_interface.cpp index b616b6ae75..afcf36f6c3 100644 --- a/components/openthread/port/esp_spi_spinel_interface.cpp +++ b/components/openthread/port/esp_spi_spinel_interface.cpp @@ -51,7 +51,7 @@ esp_err_t SpiSpinelInterface::Init(const esp_openthread_spi_host_config_t &spi_c io_conf.mode = GPIO_MODE_INPUT; io_conf.pull_up_en = GPIO_PULLUP_ENABLE; ESP_RETURN_ON_ERROR(gpio_config(&io_conf), OT_PLAT_LOG_TAG, "fail to config spi gpio"); - ESP_RETURN_ON_ERROR(gpio_install_isr_service(0), OT_PLAT_LOG_TAG, "fail to install gpio isr service"); + gpio_install_isr_service(0); // The gpio isr service may has been installed. ESP_RETURN_ON_ERROR(gpio_isr_handler_add(spi_config.intr_pin, GpioIntrHandler, this), OT_PLAT_LOG_TAG, "fail to add gpio isr handler"); m_has_pending_device_frame = false; diff --git a/components/openthread/private_include/esp_openthread_netif_glue_priv.h b/components/openthread/private_include/esp_openthread_netif_glue_priv.h index 8e06d5fc86..47e5134638 100644 --- a/components/openthread/private_include/esp_openthread_netif_glue_priv.h +++ b/components/openthread/private_include/esp_openthread_netif_glue_priv.h @@ -7,6 +7,7 @@ #pragma once #include "esp_openthread.h" +#include "openthread/ip6.h" #include "openthread/instance.h" #ifdef __cplusplus @@ -44,6 +45,17 @@ void esp_openthread_netif_glue_update(esp_openthread_mainloop_context_t *mainloo */ esp_err_t esp_openthread_netif_glue_process(otInstance *instance, const esp_openthread_mainloop_context_t *mainloop); +/** + * @brief This function judges the target address is openthread mesh local or not. + * + * @param[in] address The address. + * + * @return + * - True if the address is openthread mesh local, otherwise false + * + */ +bool is_openthread_internal_mesh_local_addr(const otIp6Address *address); + #ifdef __cplusplus } #endif diff --git a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h index 5b1b97ef01..040453a84c 100644 --- a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h @@ -446,16 +446,6 @@ #define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 #endif -/** - * @def OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE - * - * Define as 1 to set the ahead time for CSL transmit timing. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US -#define OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US 20000 -#endif - /** * @def OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE * @@ -468,6 +458,16 @@ #endif // CONFIG_OPENTHREAD_CSL_ENABLE +/** + * @def OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US + * + * Define as 1 to set the ahead time for CSL transmit timing. + * + */ +#ifndef OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US +#define OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US 20000 +#endif + #if CONFIG_OPENTHREAD_LINK_METRICS /** diff --git a/components/openthread/private_include/openthread-core-esp32x-radio-config.h b/components/openthread/private_include/openthread-core-esp32x-radio-config.h index 2d5424c378..f58432903b 100644 --- a/components/openthread/private_include/openthread-core-esp32x-radio-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-radio-config.h @@ -206,3 +206,13 @@ #endif #define OPENTHREAD_RADIO 1 + +/** + * @def OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE + * + * Define as 1 to support Thread 1.2 Link Metrics Subject feature. + * + */ +#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1 +#endif