How was this change tested:
Manual run of mqtt-client-control and python client.
MQTT connect, subscribe, unsubscribe, publish, delivery of received MQTT message and disconnect are successful. Linking and shutdown steps are successful.
Test results:
Python Paho client output
client-python-paho.exe python-paho-agent
[DEBUG] 2023-06-27 18:51:18.939 asyncio - Using selector: SelectSelector
[INFO ] 2023-06-27 18:51:18.944 GRPCLib - Initialize gRPC library
[INFO ] 2023-06-27 18:51:18.945 GRPCLink - Making gPRC client connection with 127.0.0.1:47619 as python-paho-agent...
[INFO ] 2023-06-27 18:51:19.532 GRPCLink - Client connection with Control is established, local address is 127.0.0.1
[DEBUG] 2023-06-27 18:51:19.534 grpc._cython.cygrpc - Using AsyncIOEngine.POLLER as I/O engine
[INFO ] 2023-06-27 18:51:19.774 MQTTLib - Initialize Paho MQTT library
[INFO ] 2023-06-27 18:51:19.775 GRPCLink - Handle gRPC requests
[INFO ] 2023-06-27 18:51:19.779 GRPCControlServer - Server awaiting termination
[INFO ] 2023-06-27 18:51:22.893 GRPCControlServer - createMqttConnection: clientId Python_Paho_Client broker a3t8vwpkw3sltg-ats.iot.eu-west-1.amazonaws.com:8883
[INFO ] 2023-06-27 18:51:23.136 MqttConnection - Creating MQTT 5 client with TLS
[INFO ] 2023-06-27 18:51:23.137 MqttConnection - MQTT connection ID 0 connecting...
[DEBUG] 2023-06-27 18:51:23.600 AsyncioHelper - On socket open
[DEBUG] 2023-06-27 18:51:23.601 AsyncioHelper - On socket register write
[DEBUG] 2023-06-27 18:51:23.604 AsyncioHelper - On socket unregister write
[INFO ] 2023-06-27 18:51:23.795 MqttConnection - MQTT connection ID 0 connected, client id Python_Paho_Client
[DEBUG] 2023-06-27 18:51:29.063 GRPCControlServer - Subscription: filter test/topic QoS 0 noLocal 0 retainAsPublished 0 retainHandling 2
[INFO ] 2023-06-27 18:51:29.064 GRPCControlServer - SubscribeMqtt connection_id 0
[DEBUG] 2023-06-27 18:51:29.068 AsyncioHelper - On socket register write
[DEBUG] 2023-06-27 18:51:29.070 AsyncioHelper - On socket unregister write
[DEBUG] 2023-06-27 18:51:29.194 MqttConnection - Subscribed on filters 'test/topic' with QoS 0 no local False retain as published False retain handing 2 with message id 1
[INFO ] 2023-06-27 18:51:34.235 GRPCControlServer - PublishMqtt connection_id 0 topic test/topic retain 0
[DEBUG] 2023-06-27 18:51:34.236 AsyncioHelper - On socket register write
[DEBUG] 2023-06-27 18:51:34.242 AsyncioHelper - On socket unregister write
[DEBUG] 2023-06-27 18:51:34.346 MqttConnection - onMessage message b'Hello World!' from topic 'test/topic'
[INFO ] 2023-06-27 18:51:34.347 GRPCDiscoveryClient - Sending OnReceiveMessage request agent_id 'python-paho-agent' connection_id 0 message b'Hello World!' on topic 'test/topic'
[DEBUG] 2023-06-27 18:51:34.374 MqttConnection - Published on topic 'test/topic' QoS 1 retain 0 with rc 0 message id 2
[DEBUG] 2023-06-27 18:51:39.403 GRPCControlServer - Unsubscription: filter test/topic
[INFO ] 2023-06-27 18:51:39.403 GRPCControlServer - UnsubscribeMqtt connection_id 0
[DEBUG] 2023-06-27 18:51:39.410 AsyncioHelper - On socket register write
[DEBUG] 2023-06-27 18:51:39.413 AsyncioHelper - On socket unregister write
[DEBUG] 2023-06-27 18:51:39.577 MqttConnection - Unsubscribed from filters 'test/topic' with message id 3
[INFO ] 2023-06-27 18:51:54.592 GRPCControlServer - CloseMqttConnection connection_id 0 reason 4
[INFO ] 2023-06-27 18:51:54.597 MqttConnection - Disconnect MQTT connection with reason code 4
[DEBUG] 2023-06-27 18:51:54.598 AsyncioHelper - On socket register write
[INFO ] 2023-06-27 18:51:54.599 GRPCDiscoveryClient - Sending OnMqttDisconnect request agent_id 'python-paho-agent' connection_id 0 error 'None'
[DEBUG] 2023-06-27 18:51:54.633 AsyncioHelper - On socket unregister write
[DEBUG] 2023-06-27 18:51:54.633 AsyncioHelper - On socket close
[INFO ] 2023-06-27 18:51:54.651 GRPCControlServer - shutdownAgent: reason That's it.
[INFO ] 2023-06-27 18:51:54.658 GRPCControlServer - Server termination done
[INFO ] 2023-06-27 18:51:54.660 GRPCLink - Shutdown gPRC link
[INFO ] 2023-06-27 18:51:54.688 Main - Execution done successfully
Description of changes:
Why is this change necessary:
How was this change tested: Manual run of mqtt-client-control and python client. MQTT connect, subscribe, unsubscribe, publish, delivery of received MQTT message and disconnect are successful. Linking and shutdown steps are successful.
Test results: Python Paho client output
Mqtt Client Control output
Any additional information or context required to review the change:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.