mqttConnected (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

3.12 / 1.00.00


This returns information about whether a MQTT connection is established.

 

 

Input:

handle : INT

The handle to the MQTT connection.

 

 

Returns: BOOL

TRUE if MQTT connection is established, FALSE if not.

 

 

Declaration:

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

 

 

Example:

INCLUDE rtcu.inc
 
VAR
  mqtt : INT;
END_VAR;
 
PROGRAM example;
 
BEGIN
  ...
  // Check connection
  IF mqttConnected(handle := mqtt) THEN
    DebugMsg(message := "Connected to MQTT");
  END_IF;
  ...
END;
END_PROGRAM;