XDK API  3.6.0
Documentation
Files | Data Structures | Typedefs | Enumerations | Functions

This module handles the MQTT communication. More...

+ Collaboration diagram for MQTT:

Files

file  XDK_MQTT.h
 

Data Structures

struct  MQTT_Connect_S
 Structure to represent the MQTT connect features. More...
 
struct  MQTT_Publish_S
 Structure to represent the MQTT publish features. More...
 
struct  MQTT_Setup_S
 Structure to represent the MQTT setup features. More...
 

Typedefs

typedef struct MQTT_Connect_S MQTT_Connect_T
 Typedef to represent the MQTT connect feature. More...
 
typedef struct MQTT_Publish_S MQTT_Publish_T
 Typedef to represent the MQTT publish feature. More...
 
typedef struct MQTT_Setup_S MQTT_Setup_T
 Typedef to represent the MQTT setup feature. More...
 
typedef struct MQTT_Subscribe_S MQTT_Subscribe_T
 Structure to represent the MQTT subscribe feature. More...
 
typedef void(* MQTT_SubscribeCB_T )(MQTT_SubscribeCBParam_T param)
 Typedef to the function to be called upon receiving incoming MQTT messages. More...
 
typedef struct
MQTT_SubscribeCBParam_S 
MQTT_SubscribeCBParam_T
 Typedef to represent the incoming MQTT message information. More...
 
typedef enum MQTT_Type_E MQTT_Type_T
 Typedef to represent the supported MQTT type. More...
 

Enumerations

enum  MQTT_Type_E
 Enum to represent the supported MQTT types. More...
 

Functions

Retcode_T MQTT_ConnectToBroker (MQTT_Connect_T *mqttConnect, 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...
 

Detailed Description


Data Structure Documentation

struct MQTT_Connect_S

Data Fields

uint16_t BrokerPort
 
const char * BrokerURL
 
bool CleanSession
 
const char * ClientId
 
uint32_t KeepAliveInterval
 

Field Documentation

uint16_t BrokerPort

The port number of the MQTT broker

const char* BrokerURL

The URL pointing to the MQTT broker

bool CleanSession

The clean session flag indicates to the broker whether the client wants to establish a clean session or a persistent session where all subscriptions and messages (QoS 1 & 2) are stored for the client.

const char* ClientId

The client identifier which is a identifier of each MQTT client connecting to a MQTT broker. It needs to be unique for the broker to know the state of the client.

uint32_t KeepAliveInterval

The keep alive interval (in seconds) is the time the client commits to for when sending regular pings to the broker. The broker responds to the pings enabling both sides to determine if the other one is still alive and reachable

struct MQTT_Publish_S

Data Fields

const char * Payload
 
uint32_t PayloadLength
 
uint32_t QoS
 
const char * Topic
 

Field Documentation

const char* Payload

Pointer to the payload to be published

uint32_t PayloadLength

Length of the payload to be published

uint32_t QoS

The MQTT Quality of Service level. If 0, the message is send in a fire and forget way and it will arrive at most once. If 1 Message reception is acknowledged by the other side, retransmission could occur.

const char* Topic

The MQTT topic to which the messages are to be published

struct MQTT_Setup_S
+ Collaboration diagram for MQTT_Setup_S:

Data Fields

CmdProcessor_TCmdProcessorHandle
 
bool IsSecure
 
MQTT_Type_T MqttType
 

Field Documentation

CmdProcessor_T* CmdProcessorHandle

Command processor handle to handle MQTT agent events and servicing.

bool IsSecure

Boolean representing if we will do a HTTP secure communication. Unused if MqttType is MQTT_TYPE_AWS.

MQTT_Type_T MqttType

The MQTT type

struct MQTT_Subscribe_S
+ Collaboration diagram for MQTT_Subscribe_S:

Data Fields

MQTT_SubscribeCB_T IncomingPublishNotificationCB
 
uint32_t QoS
 
const char * Topic
 

Field Documentation

MQTT_SubscribeCB_T IncomingPublishNotificationCB

The function to be called upon receiving incoming MQTT messages. Can be NULL.

uint32_t QoS

The MQTT Quality of Service level. If 0, the message is send in a fire and forget way and it will arrive at most once. If 1 Message reception is acknowledged by the other side, retransmission could occur.

const char* Topic

The MQTT topic for which the messages are to be subscribed

struct MQTT_SubscribeCBParam_S

Data Fields

const char * Payload
 
uint32_t PayloadLength
 
const char * Topic
 
uint32_t TopicLength
 

Field Documentation

const char* Payload

The incoming MQTT payload pointer

uint32_t PayloadLength

The incoming MQTT payload length

const char* Topic

The incoming MQTT topic pointer

uint32_t TopicLength

The incoming MQTT topic length

Typedef Documentation

typedef struct MQTT_Setup_S MQTT_Setup_T
typedef void(* MQTT_SubscribeCB_T)(MQTT_SubscribeCBParam_T param)
typedef enum MQTT_Type_E MQTT_Type_T

Enumeration Type Documentation

Enumerator
MQTT_TYPE_SERVALSTACK 
MQTT_TYPE_AWS 

Function Documentation

Retcode_T MQTT_ConnectToBroker ( MQTT_Connect_T mqttConnect,
uint32_t  timeout 
)
Parameters
[in]mqttConnectPointer to the MQTT connect feature
[in]timeoutTimeout in milli-second to await successful connection
Returns
RETCODE_OK on success, or an error code otherwise.

+ Here is the caller graph for this function:

Retcode_T MQTT_Enable ( void  )
Returns
RETCODE_OK on success, or an error code otherwise.
Note
  • If setup->IsSecure was enabled at the time of MQTT_Setup, then we will enable the HTTPs server certificates as well.
  • MQTT_Setup must have been successful prior.
  • WLAN_Enable must have been successful prior.
  • Do not call this API more than once.

+ Here is the caller graph for this function:

Retcode_T MQTT_PublishToTopic ( MQTT_Publish_T publish,
uint32_t  timeout 
)
Parameters
[in]subscribePointer to the MQTT publish feature
[in]timeoutTimeout in milli-second to await successful publication
Returns
RETCODE_OK on success, or an error code otherwise.

+ Here is the caller graph for this function:

Retcode_T MQTT_Setup ( MQTT_Setup_T setup)
Parameters
[in]setupPointer to the MQTT setup feature
Returns
RETCODE_OK on success, or an error code otherwise.
Note
  • This must be the first API to be called if MQTT feature is to be used.
  • Do not call this API more than once.

+ Here is the caller graph for this function:

Retcode_T MQTT_SubsribeToTopic ( MQTT_Subscribe_T subscribe,
uint32_t  timeout 
)
Parameters
[in]subscribePointer to the MQTT subscribe feature
[in]timeoutTimeout in milli-second to await successful subscription
Returns
RETCODE_OK on success, or an error code otherwise.

+ Here is the caller graph for this function:


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 Thu Mar 14 2019 19:12:50 by doxygen 1.8.8