SendMessageEx

SendMessageEx 1:

This method is called once to send a categorized (push) message to the broker. This message is then displayed in the app. This is not a message that is visible as a push message on the mobile phone.

The SendMessage method can be used to send (push) messages without a category.

Syntax

METHOD SendMessageEx : BOOL
VAR_INPUT
    sMessage : STRING(255);
    sType    : STRING(255);
END_VAR

SendMessageEx 2: Return value

Name

Type

Description

SendMessageEx

BOOL

The method returns the return value TRUE if the call was successful.

SendMessageEx 3: Inputs

Name

Type

Description

sMessage

STRING

Text of the (push) message to be sent to the broker.

sType

STRING

Category of the (push) message. Currently possible categories are: Info, Warning, Error, Critical. If an unknown category is entered, a question mark is displayed instead of the category.

Possible errors are output at the outputs bError and hrErrorCode of the function block instance.

SendMessageEx 4:

Strings in UTF-8 format

The variables of type STRING used here are based on the UTF-8 format. This STRING formatting is common for MQTT communication.

In order to be able to receive special characters and texts from a wide range of languages, the character set in the Tc3_IotCommunicator library is not limited to the typical character set of the data type STRING. Instead, the Unicode character set in UTF-8 format is used in conjunction with the data type STRING.

If the ASCII character set is used, there is no difference between the typical formatting of a STRING and the UTF-8 formatting of a STRING.