天嵌二次封装库使用手册  V2.1.2
MQTTClient_willOptions结构体 参考

#include <MQTTClient.h>

Public 属性

char struct_id [4]
 
int struct_version
 
const char * topicName
 
const char * message
 
int retained
 
int qos
 
struct {
   int   len
 
   const void *   data
 
payload
 

详细描述

MQTTClient_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for the client. In the event that a client unexpectedly loses its connection to the server, the server publishes the LWT message to the LWT topic on behalf of the client. This allows other clients (subscribed to the LWT topic) to be made aware that the client has disconnected. To enable the LWT function for a specific client, a valid pointer to an MQTTClient_willOptions structure is passed in the MQTTClient_connectOptions structure used in the MQTTClient_connect() call that connects the client to the server. The pointer to MQTTClient_willOptions can be set to NULL if the LWT function is not required.

在文件 MQTTClient.h611 行定义.

类成员变量说明

const void* MQTTClient_willOptions::data

binary payload data

在文件 MQTTClient.h636 行定义.

int MQTTClient_willOptions::len

binary payload length

在文件 MQTTClient.h635 行定义.

const char* MQTTClient_willOptions::message

The LWT payload in string form.

在文件 MQTTClient.h622 行定义.

struct { ... } MQTTClient_willOptions::payload

The LWT payload in binary form. This is only checked and used if the message option is NULL

int MQTTClient_willOptions::qos

The quality of service setting for the LWT message (see MQTTClient_message.qos and qos).

在文件 MQTTClient.h631 行定义.

int MQTTClient_willOptions::retained

The retained flag for the LWT message (see MQTTClient_message.retained).

在文件 MQTTClient.h626 行定义.

char MQTTClient_willOptions::struct_id[4]

The eyecatcher for this structure. must be MQTW.

在文件 MQTTClient.h614 行定义.

int MQTTClient_willOptions::struct_version

The version number of this structure. Must be 0 or 1 0 means there is no binary payload option

在文件 MQTTClient.h618 行定义.

const char* MQTTClient_willOptions::topicName

The LWT topic to which the LWT message will be published.

在文件 MQTTClient.h620 行定义.


该结构体的文档由以下文件生成: