test(phy): script to communicate with the awgn fg
This commit is contained in:
21
pdu_rx.py
Normal file
21
pdu_rx.py
Normal 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())
|
||||
Reference in New Issue
Block a user