mqttConnectionLoss (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

5.12 / 1.64.00


This returns information about whether a MQTT connection has been interrupted.

The mqttConnectionLoss function will return whether an interruption has been detected since last call.

 

 

Input:

handle : INT

The handle to the MQTT connection.

 

 

Returns: BOOL

TRUE if the connection has been interrupted, FALSE if not.

 

 

Declaration:

FUNCTION mqttConnectionLoss : BOOL;
VAR_INPUT
  handle : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
VAR
  mqtt : INT;
END_VAR;
 
PROGRAM example;
 
BEGIN
  ...
  // Check connection
  IF mqttConnectionLoss(handle := mqtt) THEN
    DebugMsg(message := "Connection to MQTT server has been interrupted");
  END_IF;
  ...
END;
END_PROGRAM;