@@ -378,8 +378,81 @@ def configureMQTTOperationTimeout(self, timeoutSecond):
378378 """
379379 self ._mqtt_core .configure_operation_timeout_sec (timeoutSecond )
380380
381+ def configureUsernamePassword (self , username , password = None ):
382+ """
383+ **Description**
384+
385+ Used to configure the username and password used in CONNECT packet.
386+
387+ **Syntax**
388+
389+ .. code:: python
390+
391+ # Configure user name and password
392+ myAWSIoTMQTTClient.configureUsernamePassword("myUsername", "myPassword")
393+
394+ **Parameters**
395+
396+ *username* - Username used in the username field of CONNECT packet.
397+
398+ *password* - Password used in the password field of CONNECT packet.
399+
400+ **Returns**
401+
402+ None
403+
404+ """
405+ self ._mqtt_core .configure_username_password (username , password )
406+
407+ def enableMetricsCollection (self ):
408+ """
409+ **Description**
410+
411+ Used to enable SDK metrics collection. Username field in CONNECT packet will be used to append the SDK name
412+ and SDK version in use and communicate to AWS IoT cloud. This metrics collection is enabled by default.
413+
414+ **Syntax**
415+
416+ .. code:: python
417+
418+ myAWSIoTMQTTClient.enableMetricsCollection()
419+
420+ **Parameters**
421+
422+ None
423+
424+ **Returns**
425+
426+ None
427+
428+ """
429+ self ._mqtt_core .enable_metrics_collection ()
430+
431+ def disableMetricsCollection (self ):
432+ """
433+ **Description**
434+
435+ Used to disable SDK metrics collection.
436+
437+ **Syntax**
438+
439+ .. code:: python
440+
441+ myAWSIoTMQTTClient.disableMetricsCollection()
442+
443+ **Parameters**
444+
445+ None
446+
447+ **Returns**
448+
449+ None
450+
451+ """
452+ self ._mqtt_core .disable_metrics_collection ()
453+
381454 # MQTT functionality APIs
382- def connect (self , keepAliveIntervalSecond = 30 ):
455+ def connect (self , keepAliveIntervalSecond = 600 ):
383456 """
384457 **Description**
385458
@@ -389,15 +462,15 @@ def connect(self, keepAliveIntervalSecond=30):
389462
390463 .. code:: python
391464
392- # Connect to AWS IoT with default keepalive set to 30 seconds
465+ # Connect to AWS IoT with default keepalive set to 600 seconds
393466 myAWSIoTMQTTClient.connect()
394- # Connect to AWS IoT with keepalive interval set to 55 seconds
395- myAWSIoTMQTTClient.connect(55 )
467+ # Connect to AWS IoT with keepalive interval set to 1200 seconds
468+ myAWSIoTMQTTClient.connect(1200 )
396469
397470 **Parameters**
398471
399472 *keepAliveIntervalSecond* - Time in seconds for interval of sending MQTT ping request.
400- Default set to 30 seconds.
473+ Default set to 600 seconds.
401474
402475 **Returns**
403476
@@ -407,7 +480,7 @@ def connect(self, keepAliveIntervalSecond=30):
407480 self ._load_callbacks ()
408481 return self ._mqtt_core .connect (keepAliveIntervalSecond )
409482
410- def connectAsync (self , keepAliveIntervalSecond = 30 , ackCallback = None ):
483+ def connectAsync (self , keepAliveIntervalSecond = 600 , ackCallback = None ):
411484 """
412485 **Description**
413486
@@ -417,15 +490,15 @@ def connectAsync(self, keepAliveIntervalSecond=30, ackCallback=None):
417490
418491 .. code:: python
419492
420- # Connect to AWS IoT with default keepalive set to 30 seconds and a custom CONNACK callback
493+ # Connect to AWS IoT with default keepalive set to 600 seconds and a custom CONNACK callback
421494 myAWSIoTMQTTClient.connectAsync(ackCallback=my_connack_callback)
422- # Connect to AWS IoT with default keepalive set to 55 seconds and a custom CONNACK callback
423- myAWSIoTMQTTClient.connectAsync(keepAliveInternvalSecond=55 , ackCallback=myConnackCallback)
495+ # Connect to AWS IoT with default keepalive set to 1200 seconds and a custom CONNACK callback
496+ myAWSIoTMQTTClient.connectAsync(keepAliveInternvalSecond=1200 , ackCallback=myConnackCallback)
424497
425498 **Parameters**
426499
427500 *keepAliveIntervalSecond* - Time in seconds for interval of sending MQTT ping request.
428- Default set to 30 seconds.
501+ Default set to 600 seconds.
429502
430503 *ackCallback* - Callback to be invoked when the client receives a CONNACK. Should be in form
431504 :code:`customCallback(mid, data)`, where :code:`mid` is the packet id for the connect request
@@ -1036,8 +1109,81 @@ def configureMQTTOperationTimeout(self, timeoutSecond):
10361109 # AWSIoTMQTTClient.configureMQTTOperationTimeout
10371110 self ._AWSIoTMQTTClient .configureMQTTOperationTimeout (timeoutSecond )
10381111
1112+ def configureUsernamePassword (self , username , password = None ):
1113+ """
1114+ **Description**
1115+
1116+ Used to configure the username and password used in CONNECT packet.
1117+
1118+ **Syntax**
1119+
1120+ .. code:: python
1121+
1122+ # Configure user name and password
1123+ myAWSIoTMQTTShadowClient.configureUsernamePassword("myUsername", "myPassword")
1124+
1125+ **Parameters**
1126+
1127+ *username* - Username used in the username field of CONNECT packet.
1128+
1129+ *password* - Password used in the password field of CONNECT packet.
1130+
1131+ **Returns**
1132+
1133+ None
1134+
1135+ """
1136+ self ._AWSIoTMQTTClient .configureUsernamePassword (username , password )
1137+
1138+ def enableMetricsCollection (self ):
1139+ """
1140+ **Description**
1141+
1142+ Used to enable SDK metrics collection. Username field in CONNECT packet will be used to append the SDK name
1143+ and SDK version in use and communicate to AWS IoT cloud. This metrics collection is enabled by default.
1144+
1145+ **Syntax**
1146+
1147+ .. code:: python
1148+
1149+ myAWSIoTMQTTClient.enableMetricsCollection()
1150+
1151+ **Parameters**
1152+
1153+ None
1154+
1155+ **Returns**
1156+
1157+ None
1158+
1159+ """
1160+ self ._AWSIoTMQTTClient .enableMetricsCollection ()
1161+
1162+ def disableMetricsCollection (self ):
1163+ """
1164+ **Description**
1165+
1166+ Used to disable SDK metrics collection.
1167+
1168+ **Syntax**
1169+
1170+ .. code:: python
1171+
1172+ myAWSIoTMQTTClient.disableMetricsCollection()
1173+
1174+ **Parameters**
1175+
1176+ None
1177+
1178+ **Returns**
1179+
1180+ None
1181+
1182+ """
1183+ self ._AWSIoTMQTTClient .disableMetricsCollection ()
1184+
10391185 # Start the MQTT connection
1040- def connect (self , keepAliveIntervalSecond = 30 ):
1186+ def connect (self , keepAliveIntervalSecond = 600 ):
10411187 """
10421188 **Description**
10431189
@@ -1047,10 +1193,10 @@ def connect(self, keepAliveIntervalSecond=30):
10471193
10481194 .. code:: python
10491195
1050- # Connect to AWS IoT with default keepalive set to 30 seconds
1196+ # Connect to AWS IoT with default keepalive set to 600 seconds
10511197 myAWSIoTMQTTShadowClient.connect()
1052- # Connect to AWS IoT with keepalive interval set to 55 seconds
1053- myAWSIoTMQTTShadowClient.connect(55 )
1198+ # Connect to AWS IoT with keepalive interval set to 1200 seconds
1199+ myAWSIoTMQTTShadowClient.connect(1200 )
10541200
10551201 **Parameters**
10561202
0 commit comments