]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/mqtt/src/iot_mqtt_api.c
Continued to work on the MQTT demo project.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-IoT-Libraries / c_sdk / standard / mqtt / src / iot_mqtt_api.c
index 7df5326dcc6ab60acee35f704ba17771c934782a..23133f46b78776713c4a39d5f1088ae7e5038fc0 100644 (file)
@@ -853,7 +853,7 @@ IotMqttError_t IotMqtt_Init( void )
     #endif /* if IOT_MQTT_ENABLE_SERIALIZER_OVERRIDES == 1 */\r
 \r
     /* Log initialization status. */\r
-    if( status != IOT_MQTT_SUCCESS )\r
+    if( status != IOT_MQTT_SUCCESS ) //_RB_ This will generate compiler warnings if IOT_MQTT_ENABLE_SERIALIZER_OVERRIDES != 0\r
     {\r
         IotLogError( "Failed to initialize MQTT library serializer. " );\r
     }\r
@@ -896,7 +896,7 @@ IotMqttError_t IotMqtt_Connect( const IotMqttNetworkInfo_t * pNetworkInfo,
     _mqttConnection_t * pNewMqttConnection = NULL;\r
 \r
     /* Default CONNECT serializer function. */\r
-    IotMqttError_t ( * serializeConnect )( const IotMqttConnectInfo_t *,\r
+    IotMqttError_t ( * serializeConnect )( const IotMqttConnectInfo_t *, //_RB_ Needs to be a typedef to make it easier to rease and more maintainable should the prototype change.\r
                                            uint8_t **,\r
                                            size_t * ) = _IotMqtt_SerializeConnect;\r
 \r
@@ -911,7 +911,7 @@ IotMqttError_t IotMqtt_Connect( const IotMqttNetworkInfo_t * pNetworkInfo,
     }\r
 \r
     /* Validate network interface and connect info. */\r
-    if( _IotMqtt_ValidateConnect( pConnectInfo ) == false )\r
+    if( _IotMqtt_ValidateConnect( pConnectInfo ) == false ) //_RB_ A lot of code in here that could be replaced by asserts().\r
     {\r
         IOT_SET_AND_GOTO_CLEANUP( IOT_MQTT_BAD_PARAMETER );\r
     }\r
@@ -1002,7 +1002,7 @@ IotMqttError_t IotMqtt_Connect( const IotMqttNetworkInfo_t * pNetworkInfo,
 \r
     IotLogInfo( "Establishing new MQTT connection." );\r
 \r
-    /* Initialize a new MQTT connection object. */\r
+    /* Initialize a new MQTT connection object. *///_RB_ Initialise, as per the comment, or create, as per the function name?  I don't think this does create a connection as that happens below.\r
     pNewMqttConnection = _createMqttConnection( pConnectInfo->awsIotMqttMode,\r
                                                 pNetworkInfo,\r
                                                 pConnectInfo->keepAliveSeconds );\r
@@ -1127,7 +1127,7 @@ IotMqttError_t IotMqtt_Connect( const IotMqttNetworkInfo_t * pNetworkInfo,
     IotMqtt_Assert( pOperation->u.operation.packetSize > 0 );\r
 \r
     /* Add the CONNECT operation to the send queue for network transmission. */\r
-    status = _IotMqtt_ScheduleOperation( pOperation,\r
+    status = _IotMqtt_ScheduleOperation( pOperation, // Why schedule a job if going to wait for comletion?\r
                                          _IotMqtt_ProcessSend,\r
                                          0 );\r
 \r