source/MQTTRegistration.c
/**
 * @brief publish sensor data, get sensor data, or
 *        yield mqtt client to check subscriptions
 *
 * @param[in] pvParameters UNUSED/PASSED THROUGH
 *
 * @return NONE
 */
@brief publish sensor data, get sensor data, or
yield mqtt client to check subscriptions

@param[in] pvParameters UNUSED/PASSED THROUGH

@return NONE
@brief publish sensor data get sensor data or yield mqtt client to check subscriptions @param [ in ] pvParameters UNUSED / PASSED THROUGH @return NONE
static void MQTTRegistration_ClientPublish(void) {
	LOG_AT_DEBUG(
			("%s: MQTTRegistration_ClientPublish starting \n\r", MQTTREGISTRATION_LOGPREFIX));
	Retcode_T retcode = RETCODE_OK;
	while (1) {
		retcode = MQTTRegistration_ValidateWLANConnectivity();
		if (assetStreamBuffer.length > NUMBER_UINT32_ZERO) {
			if (RETCODE_OK == retcode) {
				MqttPublishInfo.Payload = assetStreamBuffer.data;
				MqttPublishInfo.PayloadLength = assetStreamBuffer.length;
				retcode = MQTT_PublishToTopic_Z(&MqttPublishInfo,
				MQTT_PUBLISH_TIMEOUT_IN_MS);
				if (RETCODE_OK != retcode) {
					LOG_AT_ERROR(
							("%s: MQTT publish failed \n\r", MQTTREGISTRATION_LOGPREFIX));
					Retcode_RaiseError(retcode);
				}
			}
			if (RETCODE_OK != retcode) {
				Retcode_RaiseError(retcode);
			}
			memset(assetStreamBuffer.data, 0x00, SIZE_SMALL_BUF);
			assetStreamBuffer.length = NUMBER_UINT32_ZERO;
		}
		vTaskDelay(pdMS_TO_TICKS(1000));
	}
}
static void MQTTRegistration_ClientPublish ( void ) { LOG_AT_DEBUG ( ( " \n \r " , MQTTREGISTRATION_LOGPREFIX ) ) ; Retcode_T retcode = RETCODE_OK ; while ( 1 ) { retcode = MQTTRegistration_ValidateWLANConnectivity ( ) ; if ( assetStreamBuffer . length > NUMBER_UINT32_ZERO ) { if ( RETCODE_OK == retcode ) { MqttPublishInfo . Payload = assetStreamBuffer . data ; MqttPublishInfo . PayloadLength = assetStreamBuffer . length ; retcode = MQTT_PublishToTopic_Z ( & MqttPublishInfo , MQTT_PUBLISH_TIMEOUT_IN_MS ) ; if ( RETCODE_OK != retcode ) { LOG_AT_ERROR ( ( " \n \r " , MQTTREGISTRATION_LOGPREFIX ) ) ; Retcode_RaiseError ( retcode ) ; } } if ( RETCODE_OK != retcode ) { Retcode_RaiseError ( retcode ) ; } memset ( assetStreamBuffer . data , 0x00 , SIZE_SMALL_BUF ) ; assetStreamBuffer . length = NUMBER_UINT32_ZERO ; } vTaskDelay ( pdMS_TO_TICKS ( 1000 ) ) ; } }
@brief publish sensor data, get sensor data, or
        yield mqtt client to check subscriptions
@brief publish sensor data get sensor data or yield mqtt client to check subscriptions
/* Check whether the WLAN network connection is available */