XDK API  3.4.0
Documentation
Macros | Functions | Variables
MQTT.c File Reference
#include "XdkCommonInfo.h"
#include "XDK_MQTT.h"
#include <stdio.h>
#include "aws_mqtt_agent.h"
#include "aws_bufferpool.h"
#include "aws_secure_sockets.h"
#include "HTTPRestClientSecurity.h"
#include "BCDS_NetworkConfig.h"
#include "Serval_Msg.h"
#include "Serval_Http.h"
#include "Serval_HttpClient.h"
#include "Serval_Types.h"
#include "FreeRTOS.h"
#include "semphr.h"
#include "Serval_Mqtt.h"
+ Include dependency graph for MQTT.c:

Macros

#define BCDS_MODULE_ID   XDK_COMMON_ID_MQTT
 
#define MQTT_SUBSCRIBE_COUNT   1UL
 
#define MQTT_URL_FORMAT_NON_SECURE   "mqtt://%s:%d"
 
#define MQTT_URL_FORMAT_SECURE   "mqtts://%s:%d"
 

Functions

static void HandleEventIncomingPublish (MqttPublishData_T publishData)
 Event handler for incoming publish MQTT data. More...
 
Retcode_T MQTT_ConnectToBroker (MQTT_Connect_T *connect, uint32_t timeout)
 This will connect to a MQTT broker. More...
 
Retcode_T MQTT_Enable (void)
 This will enable the MQTT by connecting to the broker. More...
 
Retcode_T MQTT_PublishToTopic (MQTT_Publish_T *publish, uint32_t timeout)
 This will publish to a MQTT topic. More...
 
Retcode_T MQTT_Setup (MQTT_Setup_T *setup)
 This will setup the MQTT. More...
 
Retcode_T MQTT_SubsribeToTopic (MQTT_Subscribe_T *subscribe, uint32_t timeout)
 This will subscribe to a MQTT topic. More...
 
static retcode_t MqttEventHandler (MqttSession_T *session, MqttEvent_t event, const MqttEventData_t *eventData)
 Callback function used by the stack to communicate events to the application. Each event will bring with it specialized data that will contain more information. More...
 

Variables

static MQTT_SubscribeCB_T IncomingPublishNotificationCB
 
static MQTTAgentHandle_t mqttAgentHandle = NULL
 
static SemaphoreHandle_t MqttConnectHandle
 
static bool MqttConnectionStatus = false
 
static SemaphoreHandle_t MqttPublishHandle
 
static bool MqttPublishStatus = false
 
static SemaphoreHandle_t MqttSendHandle
 
static MqttSession_T MqttSession
 
static MQTT_Setup_T MqttSetupInfo
 
static SemaphoreHandle_t MqttSubscribeHandle
 
static bool MqttSubscriptionStatus = false
 

Detailed Description

This module handles the MQTT communication

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_COMMON_ID_MQTT
#define MQTT_SUBSCRIBE_COUNT   1UL

< Macro for the number of topics to subscribe Macro for the non secure serval stack expected MQTT URL format

#define MQTT_URL_FORMAT_NON_SECURE   "mqtt://%s:%d"

Macro for the secure serval stack expected MQTT URL format

#define MQTT_URL_FORMAT_SECURE   "mqtts://%s:%d"

Function Documentation

static void HandleEventIncomingPublish ( MqttPublishData_T  publishData)
static
Parameters
[in]publishDataEvent Data for publish

+ Here is the caller graph for this function:

static retcode_t MqttEventHandler ( MqttSession_T *  session,
MqttEvent_t  event,
const MqttEventData_t *  eventData 
)
static
Parameters
[in]sessionMQTT session
[in]eventMQTT event
[in]eventDataMQTT data based on the event

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

MQTT_SubscribeCB_T IncomingPublishNotificationCB
static

MQTT session instance

MQTTAgentHandle_t mqttAgentHandle = NULL
static
SemaphoreHandle_t MqttConnectHandle
static

MQTT setup information

bool MqttConnectionStatus = false
static

MQTT subscription status

SemaphoreHandle_t MqttPublishHandle
static

Handle for MQTT send operation

bool MqttPublishStatus = false
static
SemaphoreHandle_t MqttSendHandle
static

Handle for MQTT send operation

MqttSession_T MqttSession
static

MQTT connection status

MQTT_Setup_T MqttSetupInfo
static

MQTT incoming publish notification callback for the application

SemaphoreHandle_t MqttSubscribeHandle
static

< Handle for MQTT subscribe operation Handle for MQTT publish operation

bool MqttSubscriptionStatus = false
static

MQTT publish status


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Sat Jul 28 2018 21:51:48 by doxygen 1.8.8