receiver test
This commit is contained in:
parent
fc2a1641b9
commit
153f5872ab
2 changed files with 39 additions and 0 deletions
18
send_test_data.py
Normal file
18
send_test_data.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import random
|
||||
from time import sleep
|
||||
|
||||
def data_test(turns):
|
||||
counter = 0
|
||||
for i in range(turns):
|
||||
JSONstr = f'{{ "T" : {counter} , "V" : {random.randint(0, 255)} + }}'
|
||||
yield JSONstr
|
||||
counter += 1
|
||||
sleep(0.1)
|
||||
|
||||
def data_test_forever():
|
||||
counter = 0
|
||||
while True:
|
||||
JSONstr = f'{{ "T" : {counter} , "V" : {random.randint(0, 255)} }}'
|
||||
yield JSONstr
|
||||
counter += 1
|
||||
sleep(0.1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue