arena-py API v1.0.1
class
ArenaMQTT:
Wrapper around Paho MQTT client and EventLoop.
ArenaMQTT( web_host='arenaxr.org', realm='realm', network_latency_interval=10000, on_msg_callback=None, end_program_callback=None, video=False, debug=False, headless=False, **kwargs)
def
generate_client_id(self):
Returns a random 6 digit id
def
network_latency_update(self):
Update client latency in $NETWORK/latency
def
run_once(self, func=None, **kwargs):
Runs a user-defined function on startup
def
run_after_interval(self, func=None, interval_ms=1000, **kwargs):
Runs a user-defined function after a interval_ms milliseconds
def
run_async(self, func=None, **kwargs):
Runs a user defined aynscio function
def
run_forever(self, func=None, interval_ms=1000, **kwargs):
Runs a function every interval_ms milliseconds
async def
sleep(self, interval_ms):
Public function for sleeping in async functions
def
on_connect(self, client, userdata, flags, rc):
Paho MQTT client on_connect callback
def
do_subscribe(self, client, topic, callback):
def
on_message(self, client, userdata, msg):
def
on_message_private(self, client, userdata, msg):
async def
process_message(self):
def
on_subscribe(self, client, userdata, mid, granted_qos, properties=None):
def
on_disconnect(self, client, userdata, rc):
Paho MQTT client on_disconnect callback
def
disconnect(self):
Disconnects Paho MQTT client
def
message_callback_add(self, sub, callback):
Subscribes to new topic and adds callback
def
message_callback_remove(self, sub):
Unsubscribes to topic and removes callback
def
rcv_queue_len(self):
Return receive queue length
def
pub_queue_len(self):
Return publish queue length
Table of contents