@espressif/rainmaker-base-cdf
    Preparing search index...

    Class ESPDevice

    Index

    Constructors

    Properties

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

    Methods

    • Connects to the device.

      Returns Promise<ESPConnectStatus>

      A promise that resolves to the provisioning response.

    • 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

      • OptionalrequestBody: 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>

    • Scans for available Wi-Fi networks.

      Returns Promise<ESPWifiList[]>

      A promise that resolves to an array of Wi-Fi networks.

    • 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.

      Returns Promise<void>

    • Verifies the mapping between a user and a node.

      Parameters

      • OptionalrequestBody: 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.