Options
All
  • Public
  • Public/Protected
  • All
Menu

mqtt-now - v2.1.5

Index

Type aliases

Publisher

Publisher: (topics?: string | string[], data?: any) => void

The type of the publisher object returned by the getPublisher function

Type declaration

    • (topics?: string | string[], data?: any): void
    • Parameters

      • Optional topics: string | string[]
      • Optional data: any

      Returns void

Functions

getPublisher

  • This function returns a promise with a Publisher, which is a function that takes a list of topics and in case some data as arguments and when is called publishes everything is specified in the options given to this function. In the returned function: If no topic or an empty string is passed, it publishes all the topics. Also, in case data is passed as second argument, it will passed as the argument of each function that generates the message for a topic.

    Parameters

    • options: MqttPublisherOptions

      The options which specifies which topics and which data have to be sent and which url these things will be sent to.

    Returns Promise<Publisher>

publish

  • This function publishes every a certain amount of time the data to the topics specified by the options.

    Parameters

    • options: MqttPublishOptions

      The options which specifies which topics and which data have to be sent and which url these things will be sent to.

    Returns void

subscribe

  • This function subscribes to the topics specified by the options and handle the received messages in the way specified by the options.

    Parameters

    • options: MqttSubscribeOptions

      The options which specifies which topics are to be subscribed and which message handlers are to be executed and which url is to be listened.

    Returns void

Generated using TypeDoc