How was this change tested:
Manual run of mqtt-client-control and python client.
MQTT connect, subscribe, publish, delivery of received MQTT message and disconnect are successful, other commands are not implemented. Linking and shutdown steps are successful.
Test results:
Python Paho client output
client-python-paho.exe python-paho-agent
[DEBUG] 2023-06-26 13:05:23.198 asyncio - Using selector: SelectSelector
[INFO ] 2023-06-26 13:05:23.201 GRPCLib - Initialize gRPC library
[INFO ] 2023-06-26 13:05:23.201 GRPCLink - Making gPRC client connection with 127.0.0.1:47619 as python-paho-agent...
[INFO ] 2023-06-26 13:05:23.363 GRPCLink - Client connection with Control is established, local address is 127.0.0.1
[DEBUG] 2023-06-26 13:05:23.363 grpc._cython.cygrpc - Using AsyncIOEngine.POLLER as I/O engine
[INFO ] 2023-06-26 13:05:23.434 MQTTLib - Initialize Paho MQTT library
[INFO ] 2023-06-26 13:05:23.434 GRPCLink - Handle gRPC requests
[INFO ] 2023-06-26 13:05:23.439 GRPCControlServer - Server awaiting termination
[INFO ] 2023-06-26 13:05:26.498 GRPCControlServer - createMqttConnection: clientId Python_Paho_Client broker a3t8vwpkw3sltg-ats.iot.eu-west-1.amazonaws.com:8883
[INFO ] 2023-06-26 13:05:26.505 MqttConnection - Creating MQTT 5 client with TLS
[INFO ] 2023-06-26 13:05:26.506 MqttConnection - MQTT connection ID 0 connecting...
[DEBUG] 2023-06-26 13:05:26.896 AsyncioHelper - On socket open
[DEBUG] 2023-06-26 13:05:26.897 AsyncioHelper - On socket register write
[DEBUG] 2023-06-26 13:05:26.898 AsyncioHelper - On socket unregister write
[INFO ] 2023-06-26 13:05:27.045 MqttConnection - MQTT connection ID 0 connected, client id Python_Paho_Client
[DEBUG] 2023-06-26 13:05:32.158 GRPCControlServer - Subscription: filter test/topic QoS 0 noLocal 0 retainAsPublished 0 retainHandling 2
[INFO ] 2023-06-26 13:05:32.159 GRPCControlServer - SubscribeMqtt connection_id 0
[DEBUG] 2023-06-26 13:05:32.162 AsyncioHelper - On socket register write
[DEBUG] 2023-06-26 13:05:32.167 AsyncioHelper - On socket unregister write
[DEBUG] 2023-06-26 13:05:32.295 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-26 13:05:37.320 GRPCControlServer - PublishMqtt connection_id 0 topic test/topic retain 0
[DEBUG] 2023-06-26 13:05:37.321 AsyncioHelper - On socket register write
[DEBUG] 2023-06-26 13:05:37.325 AsyncioHelper - On socket unregister write
[DEBUG] 2023-06-26 13:05:37.427 MqttConnection - onMessage message b'Hello World!' from topic 'test/topic'
[INFO ] 2023-06-26 13:05:37.428 GRPCDiscoveryClient - Sending OnReceiveMessage request agent_id 'python-paho-agent' connection_id 0 message b'Hello World!' on topic 'test/topic'
[DEBUG] 2023-06-26 13:05:37.446 MqttConnection - Published on topic 'test/topic' QoS 1 retain 0 with rc 0 message id 2
[INFO ] 2023-06-26 13:05:42.460 GRPCControlServer - UnsubscribeRequest Placeholder TODO
[INFO ] 2023-06-26 13:05:57.476 GRPCControlServer - CloseMqttConnection connection_id 0 reason 4
[INFO ] 2023-06-26 13:05:57.477 MqttConnection - Disconnect MQTT connection with reason code 4
[DEBUG] 2023-06-26 13:05:57.480 AsyncioHelper - On socket register write
[INFO ] 2023-06-26 13:05:57.481 GRPCDiscoveryClient - Sending OnMqttDisconnect request agent_id 'python-paho-agent' connection_id 0 error 'None'
[DEBUG] 2023-06-26 13:05:57.499 AsyncioHelper - On socket unregister write
[DEBUG] 2023-06-26 13:05:57.500 AsyncioHelper - On socket close
[INFO ] 2023-06-26 13:05:57.510 GRPCControlServer - shutdownAgent: reason That's it.
[INFO ] 2023-06-26 13:05:57.512 GRPCControlServer - Server termination done
[INFO ] 2023-06-26 13:05:57.513 GRPCLink - Shutdown gPRC link
[INFO ] 2023-06-26 13:05:57.527 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, publish, delivery of received MQTT message and disconnect are successful, other commands are not implemented. 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.