mqttPendingClear (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

4.10 / 1.00.00


This function will clear the queue of pending messages.

 

 

Input:

handle : INT

The handle to the MQTT connection.

 

Returns: SINT

1

- Invalid MQTT connection.

0

- Pending messages cleared.

 

Declaration:

FUNCTION mqttPendingClear : SINT;
VAR_INPUT
  handle   : INT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  mqtt : INT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  // Clear any pending messages
  IF mqttPendingCount(handle:=mqtt) > 0 THEN
    mqttPendingClear(handle:=mqtt);
  END_IF;
  ...
END;
 
END_PROGRAM;