Constructors

Properties

advertisementData?: { [key: string]: any }[]
capabilities?: string[]
connected?: boolean
ESPProvisionAdapter: ESPProvisionAdapterInterface = ESPRMBase.ESPProvisionAdapter
name: string
security: number
transport: string
username?: string
versionInfo?: { [key: string]: any }[]

Methods

  • Disconnect the device.

    Returns Promise<void>

  • Gets the capabilities of the device.

    Returns Promise<string[]>

    A promise that resolves to an array of capabilities.

  • Gets the version info of the device.

    Returns Promise<{ [key: string]: any }>

    A promise that resolves to an object containing version info.

  • Initialize session with the device.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the session was successfully initialized.

  • Initiates a user node mapping request.

    Parameters

    • requestBody: Record<string, any> = {}

      The request body for the user node mapping.

    Returns Promise<any>

    A promise that resolves to the response from the API.

  • Provisions the device with the given Wi-Fi credentials.

    Parameters

    • ssid: string

      The SSID of the Wi-Fi network.

    • passphrase: string

      The passphrase of the Wi-Fi network.

    • onProgress: (message: ESPProvResponse) => void

      A callback function to report progress.

    • OptionalgroupId: string

      (optional) - The unique identifier of the group to which the node should be added.

    Returns Promise<void>

  • Sends data to the device.

    Parameters

    • endPoint: string

      The endpoint to send data to.

    • data: string

      The data to send.

    Returns Promise<string>

    A promise that resolves to the response data.

  • Sets the network credentials for the device.

    Parameters

    • ssid: string

      The SSID of the Wi-Fi network.

    • passphrase: string

      The passphrase of the Wi-Fi network.

    Returns Promise<ESPProvisionStatus>

  • Sets the proof of possession for the device.

    Parameters

    • proofOfPossession: string

      The proof of possession string.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the proof of possession was successfully set.

  • Starts the assisted claiming process. This method handles the complete claiming flow:

    1. Send ClaimStart to device
    2. Get device info and send to cloud
    3. Send ClaimInit with cloud response to device
    4. Get CSR from device
    5. Send CSR to cloud for verification
    6. Send certificate to device

    Parameters

    Returns Promise<void>

    Promise that resolves when claiming is complete

    Error if claiming fails at any step

  • Verifies the mapping between a user and a node.

    Parameters

    • requestBody: Record<string, any> = {}

      The request body for the user node mapping verification.

    Returns Promise<ESPAPIResponse>

    A promise that resolves to the response from the API.