Skip to content

Commit

Permalink
Set qos paramter
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Nov 26, 2023
1 parent 4226654 commit 0df7412
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
pkt_last_id_rcv = 0
t0_ms = 0


# test parameters
max_buf_size = -1 # -1=autodetect
pkt_incr_sz = 1024
qos = 0

use_oneshot = True

Expand Down Expand Up @@ -125,7 +126,7 @@ async def main():
client.up.clear()

topic = "stress_test/cln"
await client.subscribe(topic, qos=0)
await client.subscribe(topic, qos=qos)

try:
if max_buf_size == -1:
Expand Down Expand Up @@ -157,7 +158,7 @@ async def main():

struct.pack_into("I", bufwr, 0, i) # first byte = pl size
try:
await client.publish("stress_test/cln", bufwr[:i], oneshot=use_oneshot)
await client.publish("stress_test/cln", bufwr[:i], qos=qos, oneshot=use_oneshot)
_ = i
except Exception as ex:
gc.collect()
Expand Down

0 comments on commit 0df7412

Please sign in to comment.