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

Public Member Functions

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

Member Function Documentation

◆ set() [1/2]

String set ( int  ,
int  ,
int  ,
int   
)
Description
This api sends a CoAP message.
Syntax
bg77.qcoapsend.set(clientID,type,code_value,opt_bitmask,)
Parameters
clientIDint Integer type. CoAP client identifier. Range: 0–5.
typeint Integer type. The CoAP message type.
  • 0 Confirmable (CON)
  • 1 Non-confirmable (NON)
  • 2 Acknowledgement
  • 3 Reset
code_valueint Integer type. Request or response code value. See Table 4 for details.
opt_bitmaskint Integer type. Currently options can be preset in CoAP client by AT+QCOAPOPTIOIN. If any bit in the bitmask of this parameter is set to 1, the corresponding option will be added to a CoAP packet. Value Bitmask Description
  • 0 00000000 No option is added to the CoAP packet
  • 1 00000001 Add the option of option index 0 to the CoAP packet
  • 2 00000010 Add the option of option index 1 to the CoAP packet
  • 3 00000011 Add options of option index 0 and 1 to the CoAP packet
  • 4 00000100 Add the option of option index 3 to the CoAP packet
  • 5 00000101 Add options of option index 0 and 3 to the CoAP packet ...
  • 253 11111101 Add options of option index 0 and 2–7 to the CoAP packet
  • 254 11111110 Add options of option index 1–7 to the CoAP packet
  • 255 11111111 Add options of option index 0–7 to the CoAP packet
Returns
String response

◆ set() [2/2]

String set ( int  ,
int  ,
int  ,
int  ,
int   
)
Description
This api sends a CoAP message.
Syntax
bg77.qcoapsend.set(clientID,type,code_value,opt_bitmask,payload_length)
Parameters
clientIDint Integer type. CoAP client identifier. Range: 0–5.
typeint Integer type. The CoAP message type.
  • 0 Confirmable (CON)
  • 1 Non-confirmable (NON)
  • 2 Acknowledgement
  • 3 Reset
code_valueint Integer type. Request or response code value. See Table 4 for details.
opt_bitmaskint Integer type. Currently options can be preset in CoAP client by AT+QCOAPOPTIOIN. If any bit in the bitmask of this parameter is set to 1, the corresponding option will be added to a CoAP packet. Value Bitmask Description
  • 0 00000000 No option is added to the CoAP packet
  • 1 00000001 Add the option of option index 0 to the CoAP packet
  • 2 00000010 Add the option of option index 1 to the CoAP packet
  • 3 00000011 Add options of option index 0 and 1 to the CoAP packet
  • 4 00000100 Add the option of option index 3 to the CoAP packet
  • 5 00000101 Add options of option index 0 and 3 to the CoAP packet ...
  • 253 11111101 Add options of option index 0 and 2–7 to the CoAP packet
  • 254 11111110 Add options of option index 1–7 to the CoAP packet
  • 255 11111111 Add options of option index 0–7 to the CoAP packet
payload_lengthint Integer type. The length of the data to be sent. Maximum length: 1024 bytes. If this parameter is omitted, data of any length but not exceeding 1024 bytes can be input.
       @return  String  response