2022-11-12 22:21:23 +08:00
|
|
|
|
|
|
|
class _MQTT:
|
|
|
|
def __init__(self, ip: str, port: int, clinetID: str,
|
|
|
|
username: str, password: str, version: str,
|
|
|
|
ca: str, keepalive: int): ...
|
2022-11-13 15:16:08 +08:00
|
|
|
|
|
|
|
def __del__(self): ...
|
2022-11-20 19:01:05 +08:00
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
def setClientID(self, id: str) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""Set the ClientID of the MQTTClient."""
|
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
def setUsername(self, name: str) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""Set the Username of the MQTTClient."""
|
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
def setPassword(self, passwd: str) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""Set the Password of the MQTTClient."""
|
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
def setVersion(self, version: str) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""Set the Version of the MQTTClient."""
|
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
def setCa(self, ca: str) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""Set the Ca of the MQTTClient."""
|
|
|
|
|
2022-12-18 00:41:57 +08:00
|
|
|
def setKeepAlive(self, time: int) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""Set the KeepAlive of the MQTTClient."""
|
|
|
|
|
2022-12-18 00:41:57 +08:00
|
|
|
def setWill(self, topic: str, payload: str, qos: int, retain: int) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""Set the Will of the MQTTClient."""
|
|
|
|
|
|
|
|
def connect(self) -> int:
|
|
|
|
pass
|
|
|
|
"""connect to the mqtt-server."""
|
|
|
|
|
|
|
|
def disconnect(self) -> int:
|
|
|
|
pass
|
|
|
|
"""disconnect to the mqtt-server."""
|
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
def subscribe(self, topic: str, qos: int, cb: any) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""subscribe to the mqtt-server."""
|
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
def unsubscribe(self, topic: str) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""unsubscribe to the mqtt-server."""
|
|
|
|
|
2022-12-11 20:09:29 +08:00
|
|
|
def listSubscribrTopic(self) -> list:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""listSubscribrTopic """
|
|
|
|
|
2022-12-18 00:41:57 +08:00
|
|
|
def publish(self,topic: str, qos:int, , payload: str) -> int:
|
2022-11-20 19:01:05 +08:00
|
|
|
pass
|
|
|
|
"""publish to the mqtt-server."""
|
|
|
|
|
|
|
|
def setPort(self, port: int) -> int:
|
|
|
|
"""Set the port num of the MQTTClient."""
|
|
|
|
|
|
|
|
def setHost(self, host_url: str) -> int:
|
|
|
|
"""Set the host_url of the MQTTClient."""
|
2022-11-23 21:39:59 +08:00
|
|
|
|
2022-12-18 00:41:57 +08:00
|
|
|
def getMsg(self,signal:int) -> str:
|
|
|
|
pass
|
|
|
|
"""callback fun get msg"""
|
|
|
|
|
|
|
|
def getTopic(self,signal:int) -> str:
|
|
|
|
pass
|
|
|
|
"""callback fun get topic"""
|
|
|
|
|
|
|
|
def setDisconnectHandler(self,cb: any) -> int:
|
|
|
|
pass
|
|
|
|
"""set disconnect callback fun."""
|
|
|
|
|
2022-11-23 21:39:59 +08:00
|
|
|
|
|
|
|
def __del__():
|
|
|
|
pass
|