test(phy): script to communicate with the awgn fg

This commit is contained in:
2025-10-30 01:13:20 +01:00
parent 0fcda39647
commit 0489d8fc31
3 changed files with 34 additions and 24 deletions

21
pdu_rx.py Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env python
import asyncio
from time import sleep
PACKET_LEN=128
async def tcp_client():
port = 50001
reader, writer = await asyncio.open_connection(
'127.0.0.1', port)
with open("loremipsum", "rb") as file_to_send:
while message := file_to_send.read(PACKET_LEN):
writer.write(message)
sleep(1)
while message := await reader.read(PACKET_LEN):
print(f"Got: {message.decode()}\n\n")
asyncio.run(tcp_client())