RUI3 (RAK Unified Interface 3) - RAK4631
bg77::qmtpub

Public Member Functions

String set (int, int, int, int, String, String)
 
String set (int, int, int, int, String, int, String)
 

Member Function Documentation

◆ set() [1/2]

String set ( int  ,
int  ,
int  ,
int  ,
String  ,
String   
)
Description
This api is used to pulish messages by a client to a server for distribution to interested subscribers
Syntax
bg77.qmtpub.set(tcpconnectID,msgID,qos,retain,topic,data)
Parameters
tcpconnectIDint MQTT socket identifier. The range is 0-5.
msgIDint Message identifier of packet. The range is 0-65535. It will be 0 only when <qos>=0.
qosint The QoS level at which the client wants to publish the messages.
  • 0 At most once
  • 1 At least once
  • 2 Exactly once
retainint Whether or not the server will retain the message after it has been delivered to the current subscribers.
  • 0 The server will not retain the message after it has been delivered to the current subscribers
  • 1 The server will retain the message after it has been delivered to the current subscribers
topicString Topic that needs to be published.
dataString data to be sent.
Returns
String response

◆ set() [2/2]

String set ( int  ,
int  ,
int  ,
int  ,
String  ,
int  ,
String   
)
Description
This api is used to pulish messages by a client to a server for distribution to interested subscribers
Syntax
bg77.qmtpub.set(tcpconnectID,msgID,qos,retain,topic,msglen,data)
Parameters
tcpconnectIDint MQTT socket identifier. The range is 0-5.
msgIDint Message identifier of packet. The range is 0-65535. It will be 0 only when <qos>=0.
qosint The QoS level at which the client wants to publish the messages.
  • 0 At most once
  • 1 At least once
  • 2 Exactly once
retainint Whether or not the server will retain the message after it has been delivered to the current subscribers.
  • 0 The server will not retain the message after it has been delivered to the current subscribers
  • 1 The server will retain the message after it has been delivered to the current subscribers
topicString Topic that needs to be published.
msglenint Length of the message to be published. The range is 1-1548. Unit: byte.
dataString data to be sent.
Returns
String response