Base class for configuring and managing the ESP Rainmaker SDK.

Constructors

Properties

ESPAppUtilityAdapter: ESPAppUtilityAdapterInterface

App utility adapter for the SDK.

ESPLocalControlAdapter: ESPLocalControlAdapterInterface

Local control adapter for the SDK.

ESPLocalDiscoveryAdapter: ESPLocalDiscoveryAdapterInterface

Local discovery adapter for the SDK.

ESPNotificationAdapter: ESPNotificationAdapterInterface

Notification adapter for the SDK.

ESPOauthAdapter: ESPOauthAdapterInterface

Oauth adapter for the SDK.

ESPProvisionAdapter: ESPProvisionAdapterInterface

Provisioning adapter for the SDK.

ESPStorageAdapter: ESPRMStorageAdapterInterface

Storage adapter for the SDK.

isLoggingEnabled: boolean = false

Indicates whether logging is enabled.

transportOrder: ESPTransportMode[] = ...

Priority queue of transport modes.

Methods

  • Configures the ESPRMBase instance with the specified configuration. Validates the configuration and initializes necessary services.

    Parameters

    Returns void

    If the configuration is invalid.

  • Retrieves the current version of the package.

    Returns string

    The version of the package as a string.

  • Sets the logging status for the ESPRMBase SDK.

    Parameters

    • status: boolean

      A boolean indicating whether to enable (true) or disable (false) logging.

    Returns void

  • Creates and retrieves a new instance of the ESPRMAuth class.

    Returns ESPRMAuth

    An instance of the ESPRMAuth class.

    If the SDK is not configured.

  • Retrieves the MQTT host.

    Returns Promise<string>

    A promise that resolves to the MQTT host.

    If the SDK is not configured.

  • Sets the order of transport modes.

    This method allows you to specify the preferred order of transport modes (e.g., local, cloud, etc.) that the ESPRMBase instance should use when communicating with nodes devices. The transport modes are tried in the order they are provided until a successful connection is established.

    Parameters

    • transportOrder: ESPTransportMode[]

      An array of transport modes in the preferred order.

    Returns void

    const transportOrder = [ESPTransportMode.WIFI, ESPTransportMode.BLE];
    espRMBaseInstance.setTransportOrder(transportOrder);