IPWorks IoT 2020 Delphi Edition

Questions / Feedback?

TopicInfo Event

Fired when the client receives a REGISTER packet from the gateway assigning a topic id to a topic name.

Syntax

type TTopicInfoEvent = procedure (
  Sender: TObject;
  TopicId: Integer;
  const TopicName: String;
  var ReturnCode: Integer
) of Object;

property OnTopicInfo: TTopicInfoEvent read FOnTopicInfo write FOnTopicInfo;

Remarks

A gateway sends a REGISTER packet to a client if it wants to inform that client about the topic name and the assigned topic id that it will use later on when sending PUBLISH messages of the corresponding topic name. The client must establish a new topic id mapping to the topic name indicated.

This happens for example when the client connects without starting a clean session or the client has subscribed to topic names that contain wildcard characters.

When a REGISTER packet is received, the component will respond with a REGACK packet. To set the value of the return code contained in the packet, set it to one of the below values.

  • 0: accepted
  • 1: rejected - congestion
  • 2: rejected - invalid topic id
  • 3: rejected - not supported

When a client subscribes to a topic with wildcard characters, the specific topic names it will receive messages on have not yet been registered to topic ids, so the first step in receiving such messages is the REGISTER packet. It can then receive incoming messages with that id. See MessageIn for more.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 Delphi Edition - Version 20.0 [Build 8265]