TsgcWSPClient_MQTTMethods › WriteData

WriteData Method

Writes a pre-built MQTT control packet directly over the WebSocket transport.

Syntax

procedure WriteData(const aText: String);

Parameters

NameTypeDescription
aTextconst StringRaw payload to transmit inside a binary WebSocket frame. Typically a hex-encoded MQTT packet produced by an external encoder.

Remarks

Advanced, low-level escape hatch for sending experimental or vendor-specific MQTT packets that the high-level API does not expose. The text is sent verbatim after hex-decoding, bypassing packet-id tracking, flow control and QoS bookkeeping. Misuse can desynchronise the session; prefer Publish, Subscribe, UnSubscribe, Disconnect or Auth whenever possible.

Example

// send a crafted MQTT PINGREQ (0xC0 0x00)
MQTT.WriteData('C000');

Back to Methods