Default implementation of an ICommunicationInterface.

This layer will use mqtt to connect and transport messages.

Defaultly all messages will be subscribed on the following topics:

  • +/nope/<eventname>

Defaultly all messages will be published on the following topics:

  • <preTopic>/nope/<eventname>
  • preTopic is set to the hostname.

The Layer is able to forward data, events etc to default ports. Asume data is emitted using the dataChanged emit. If the flag forwardToCustomTopics is set to true, the path of the data will directly forward to mqtt.

Hierarchy

  • MQTTLayer

Implements

Constructors

  • Creates an instance of MQTTLayer.

    Memberof

    MQTTLayer

    Parameters

    • uri: string

      Uri of the Broker. e.g. mqtt://localhost:1883 or ws://localhost:9000.

    • Optional logger: ValidLoggerDefinition = "info"

      Logger level

    • Optional preTopic: string = ...

      Defaultly all messages will be published on the following topics: <preTopic>/nope/<eventname>. preTopic is defaultly set to the hostname of the node in which NoPE is running.

    • Optional qos: 0 | 1 | 2 = 2

      The QOS of mqtt. see https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels/ for more details. Default = Exactly once. Otherwise there might be an issue.

    • Optional forwardToCustomTopics: boolean = true

      The Layer is able to forward data, events etc to default ports. This flag enables this behavior

    Returns MQTTLayer

Properties

connected: NopeObservable<boolean, boolean, boolean, IEventAdditionalData>

Flag, indication, whether the Layer is connected or not.

considerConnection: boolean
forwardToCustomTopics: boolean = true

The Layer is able to forward data, events etc to default ports. This flag enables this behavior

id: string

See id

preTopic: string = ...

Defaultly all messages will be published on the following topics: <preTopic>/nope/<eventname>. preTopic is defaultly set to the hostname of the node in which NoPE is running.

qos: 0 | 1 | 2 = 2

The QOS of mqtt. see https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels/ for more details. Default = Exactly once. Otherwise there might be an issue.

receivesOwnMessages: boolean

Used to show, whether the the layer receives its own messages

Memberof

ICommunicationInterface

uri: string

Uri of the Broker. e.g. mqtt://localhost:1883 or ws://localhost:9000.

Methods

Generated using TypeDoc