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

Public Member Functions

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

Member Function Documentation

◆ get()

String get ( String  ,
int   
)
Description
This api is used to configure optional parameters of MQTT.
Syntax
bg77.qmtcfg.set(para,tcpconnectID)
Parameters
paraString String type.
  • "version"
  • "pdpcid"
  • "ssl"
  • "keepalive"
  • "session"
  • "prefix"
  • "timeout"
  • "will"
  • "recv/mode"
  • "aliauth"
tcpconnectIDint MQTT socket identifier. The range is 0-5
Returns
String response

◆ set() [1/6]

String set ( String  ,
int  ,
int   
)
Description
This api is used to configure optional parameters of MQTT.
Syntax
bg77.qmtcfg.set(para,tcpconnectID,conf)
Parameters
paraString String type.
  • "version"
  • "pdpcid"
  • "ssl"
  • "keepalive"
  • "session"
  • "prefix"
  • "timeout"
  • "will"
  • "recv/mode"
tcpconnectIDint MQTT socket identifier. The range is 0-5
confint
  • "version" int MQTT protocol version.
    • 3 MQTT v3.1
    • 4 MQTT v3.1.1
  • "pdpcid" int The PDP to be used by the MQTT client. The range is 1-16. The default value is 1.
  • "ssl" int MQTT SSL mode.
    • 0 Use normal TCP connection for MQTT
    • 1 Use SSL TCP secure connection for MQTT
  • "keepalive" int Keep-alive time. The range is 0-3600. The default value is 120. Unit: second. It defines the maximum time interval between messages received from a client. If the server does not receive a message from the client within 1.5 times of the keep-alive time period, it disconnects the client as if the client has sent a DISCONNECT message.
    • 0 No limitations on the maximum time interval between messages received from a client
  • "session" int Configure the session type.
    • 0 The server must store the subscriptions of the client after it is disconnected.
    • 1 The server must discard any previously maintained information about the client and treat the connection as “clean”.
  • "timeout" int Timeout of the packet delivery. The range is 1-60. The default value is 5. Unit: second.
  • "will" int Configure the Will flag.
    • 0 Ignore the Will flag configuration
    • 1 Require the Will flag configuration
  • "recv/mode" int Integer type. The MQTT message receiving mode.
    • 0 MQTT message received from server will be contained in URC
    • 1 MQTT message received from server will not be contained in URC
Returns
String response

◆ set() [2/6]

String set ( String  ,
int  ,
String  ,
int   
)
Description
This api is used to configure optional parameters of MQTT.
Syntax
bg77.qmtcfg.set(para,tcpconnectID,conf1,conf2)
Parameters
paraString String type.
  • "prefix"
tcpconnectIDint MQTT socket identifier. The range is 0-5
conf1String
  • "prefix" The prefix of IPv4-converted IPv6 address.
conf2int
  • "prefix" The length of the prefix string. The value can be 32, 40, 48, 56, 64 or 96. Unit: Byte
Returns
String response

◆ set() [3/6]

String set ( String  ,
int  ,
int  ,
int   
)
Description
This api is used to configure optional parameters of MQTT.
Syntax
bg77.qmtcfg.set(para,tcpconnectID,conf1,conf2)
Parameters
paraString String type.
  • "ssl"
  • "timeout"
  • "recv/mode"
tcpconnectIDint MQTT socket identifier. The range is 0-5
conf1int
  • "ssl" int MQTT SSL mode.
    • 0 Use normal TCP connection for MQTT
    • 1 Use SSL TCP secure connection for MQTT
  • "timeout" Timeout of the packet delivery. The range is 1-60. The default value is 5. Unit: second.
  • "recv/mode" Integer type. The MQTT message receiving mode.
    • 0 MQTT message received from server will be contained in URC
    • 1 MQTT message received from server will not be contained in URC
conf2int
  • "ssl" int SSL context index. The range is 0-5.
  • "timeout" Retry times when packet delivery times out. The range is 0-10. The default value is 3.
  • "recv/mode" Integer type.
    • 0 Length of MQTT message received from server will not be contained in URC
    • 1 Length of MQTT message received from server will be contained in URC
Returns
String response

◆ set() [4/6]

String set ( String  ,
int  ,
int  ,
int  ,
int   
)
Description
This api is used to configure optional parameters of MQTT.
Syntax
bg77.qmtcfg.set(para,tcpconnectID,conf1,conf2,conf3)
Parameters
paraString String type.
  • "timeout"
tcpconnectIDint MQTT socket identifier. The range is 0-5
conf1int
  • "timeout" int Timeout of the packet delivery. The range is 1-60. The default value is 5. Unit: second.
conf2int
  • "timeout" int Retry times when packet delivery times out. The range is 0-10. The default value is 3.
conf3int
  • "timeout" int
    • 0 Not report timeout message when transmitting packet
    • 1 Report timeout message when transmitting packet
Returns
String response

◆ set() [5/6]

String set ( String  ,
int  ,
int  ,
int  ,
int  ,
String  ,
String   
)
Description
This api is used to configure optional parameters of MQTT.
Syntax
bg77.qmtcfg.set(para,tcpconnectID,conf1,conf2,conf3,conf4,conf5)
Parameters
paraString String type.
  • "will"
tcpconnectIDint MQTT socket identifier. The range is 0-5
conf1int
  • "will" int Configure the Will flag.
    • 0 Ignore the Will flag configuration
    • 1 Require the Will flag configuration
conf2int
  • "will" int Quality of service for message delivery.
    • 0 At most once
    • 1 At least once
    • 2 Exactly once
conf3int
  • "will" int The Will retain flag is only used on PUBLISH messages.
    • 0 When a client sends a PUBLISH message to a server, the server will not hold on to the message after it has been delivered to the current subscribers
    • 1 When a client sends a PUBLISH message to a server, the server should hold on to the message after it has been delivered to the current subscribers
conf4String
  • "will" int Will topic string.
conf5String
  • "will" int The Will message defines the content of the message that is published to the Will topic if the client is unexpectedly disconnected. It can be a zero-length message.
Returns
String response

◆ set() [6/6]

String set ( String  ,
int  ,
String  ,
String  ,
String   
)
Description
This api is used to configure optional parameters of MQTT.
Syntax
bg77.qmtcfg.set(para,tcpconnectID,conf1,conf2,conf3)
Parameters
paraString String type.
  • "aliauth"
tcpconnectIDint MQTT socket identifier. The range is 0-5
conf1String
  • "aliauth" int Product key issued by AliCloud.
conf2String
  • "aliauth" int
conf3String
  • "aliauth" int Device secret key issued by AliCloud.
Returns
String response