mqttClose (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

3.12 / 1.00.00


This function will close a connection to a MQTT server. After this function is called the handle is invalid and can no longer be used.

Please also see mqttOpen.

 

 

Input:

handle : INT

The handle to the MQTT connection.

 

 

Returns: INT

None.

 

 

Declaration:

FUNCTION mqttClose;
VAR_INPUT
  handle : INT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  mqtt     : INT;
END_VAR;
 
PROGRAM example;
 
  gsmPower(power := ON);
  gprsOpen();
 
BEGIN
  mqtt := mqttOpen(ip := "test.mosquitto.org", port := 1883, clientid := "Example");
  ...
  // Disconnect from MQTT server
  mqttClose(handle := mqtt);
  ...
END;
END_PROGRAM;