Options
All
  • Public
  • Public/Protected
  • All
Menu

A proxy object to configure a local MQTT broker that is in bridge mode

Hierarchy

  • MQTTBridgeConfig

Index

Constructors

constructor

Properties

Private adapter

Private address

address: number

Methods

Private _buildBridge

  • _buildBridge(itemId: BridgeEnum, itemData: string): Promise<void>

Private _clearPendingBridge

  • _clearPendingBridge(): Promise<void>

Private _sendTLSFile

  • _sendTLSFile(source: string, tlsFileType: TLSEnum): Promise<void>

addBridge

  • addBridge(name: string, url: string, port?: number, remoteUsername?: string | null, remotePassword?: string | null, tls?: boolean | null): Promise<void>
  • Brokers currently supported must be running with anonymous connections allowed, or require a username and/or password for auth. If you are using TLS, you should have sent the required files over using the TLS methods in this proxy first.

    Please note that we currently only support a single TLS connected broker. If you overwrite the TLS files that another connection is using, you will break it.

    You can add connections that have either plain or password authentication in any quantity.

    Parameters

    • name: string

      Unique connection name.

    • url: string

      IP or URL that the bridged broker is running on

    • Default value port: number = 1883

      Port used by the bridged broker. Defaults to 1883. Must be numeric.

    • Default value remoteUsername: string | null = null

      Optional username if the bridge requires one

    • Default value remotePassword: string | null = null

      Optional password if the bridge requires one

    • Default value tls: boolean | null = null

      Optionally set TLS mode. Send certificates first.

    Returns Promise<void>

listFullMosquittoConfig

  • listFullMosquittoConfig(): Promise<string>
  • The actual text content of the entire mosquitto configuration file.

    Right now, this just contains bridge info, but in the future might also contain security settings, certificate file locations for various bridges, and other configurable items.

    Returns Promise<string>

    The full mosquitto config

removeBridge

  • removeBridge(bridgeName: string): Promise<void>
  • Remove an existing bridge by name

    Parameters

    • bridgeName: string

      Name of the bridge that you wish to remove

    Returns Promise<void>

sendCAFile

  • sendCAFile(source: string): Promise<void>
  • The CA file is typically obtained from your certificate authority. Will overwrite an existing CA file.

    It might show up with a name like rootCA.pem

    Parameters

    • source: string

      The source data file sent as a string

    Returns Promise<void>

sendCertfile

  • sendCertfile(source: string): Promise<void>
  • Your CA certificate. Needs to be pem encoded. Will overwrite an existing CA certificate.

    Parameters

    • source: string

      The source data file sent as a string

    Returns Promise<void>

sendKeyFile

  • sendKeyFile(source: string): Promise<void>
  • Your private keyfile. Should be pem encoded. Will overwrite an existing keyfile.

    Parameters

    • source: string

      The source data file sent as a string

    Returns Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc