Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MqttSubscribeOptions

The interface contians the options of the subscribe function.

Hierarchy

  • MqttOptions
    • MqttSubscribeOptions

Index

Properties

Optional actions

The actions that specifies which topics you want to subscribe to and what to do with the received messages.

Optional host

host: string

Specifies the host to use in the url string. Note: overwritten by url property.

Optional messageType

messageType: MessageType

The type of the message given as parameter of onMessage callback. Default: BUFFER. Note: overwritten by the more-specific messageType option whether specified in a certain topic.

Optional onError

onError: (error: Error) => void

Specifies what will be executed in case of an error. Note: overwritten by the more-specific onError option whether specified in a certain topic.

Type declaration

    • (error: Error): void
    • Parameters

      • error: Error

      Returns void

Optional onMessage

onMessage: (message: string | Buffer) => void

What will be done with the received messages. Note: overwritten by the more-specific onMessage option whether specified in a certain topic.

Type declaration

    • (message: string | Buffer): void
    • Parameters

      • message: string | Buffer

      Returns void

Optional port

port: number

Specifies the port to use in the url string. Note: overwrites the port specified by type property but is overwritten by url property.

Optional protocol

protocol: string

Specifies the protocol to use in the url string. Note: overwrites the protocol specified by type property but is overwritten by url property.

Optional type

type: Protocol

If not overwritten, the protocol and the port will be determined by this property.

Optional url

url: string

Specifies the url used by the connection. Note: overwrites all the other properties that specify the url.

Generated using TypeDoc