:py:mod:`expliot.core.protocols.internet.mqtt.aws` ================================================== .. py:module:: expliot.core.protocols.internet.mqtt.aws .. autoapi-nested-parse:: Wrapper for AWSIoTPythonSDK MQTT functionality Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: expliot.core.protocols.internet.mqtt.aws.AwsMqttClient Attributes ~~~~~~~~~~ .. autoapisummary:: expliot.core.protocols.internet.mqtt.aws.DEFAULT_AWSIOT_PORT expliot.core.protocols.internet.mqtt.aws.DEFAULT_AWSIOT_TIMEOUT .. py:data:: DEFAULT_AWSIOT_PORT :annotation: = 8883 .. py:data:: DEFAULT_AWSIOT_TIMEOUT :annotation: = 5 .. py:class:: AwsMqttClient(client_id, protocol_type=MQTTv3_1_1, use_websocket=False, clean_session=True) Bases: :py:obj:`AWSIoTPythonSDK.MQTTLib.AWSIoTMQTTClient` Wrapper on AWSIoTMQTTClient class. It implements easy configuration method, default callbacks and connection state check. If you need customized configuration and callbacks, directly use AWSIoTMQTTClient instead. .. py:method:: _onlinecb() A callback method that is called when the thing gets connected to the AWS IoT endpoint. .. py:method:: _offlinecb() A callback method that is called when the thing gets disconnected from the AWS IoT endpoint. .. py:method:: easy_disconnect() Wrapper on super.disconnect() with a check for valid connection before disconnecting. For resource cleanup we need to make sure and call disconnect() in finally clause in the plugins, however if it is not connected disconnect() raises an Exception, which we need to avoid. Hence, this implementation. .. py:method:: easy_config(**kwargs) Wrapper on different configuration methods in one go and provides simple callbacks to monitor connection and subscribe. :param host: The AWS endpoint hostname :param port: The AWS endpoint port :param use_websocket: Use websocket or not :param rootca: AWS Root CA file :param privatekey: AWS Thing private key file :param cert: AWS Thing certificate file :param user: User Name :param passwd: Password :param timeout: Connection and MQTT operation timeout