• Repeatedly attempts to connect a Pixel die using an exponential back off strategy. It stops trying to connect once it has reached the given number of retries.

    We recommend using this function to connect to a Pixel rather than calling directly the Pixel.connect function.

    Parameters

    • pixel: Pixel

      The Pixel to connect to.

    • Optional opt: {
          onWillRetry?: ((delay, retriesLeft, error) => void);
          retries?: number;
      }
      • Optional onWillRetry?: ((delay, retriesLeft, error) => void)

        Called before scheduling a retry.

          • (delay, retriesLeft, error): void
          • Called before scheduling a retry.

            Parameters

            • delay: number
            • retriesLeft: number
            • error: unknown

            Returns void

      • Optional retries?: number

        Number of retries before aborting.

    Returns Promise<void>

    See

    Auto-reconnect code provided by Google: https://googlechrome.github.io/samples/web-bluetooth/automatic-reconnect-async-await.html

    Remarks

    By default it will attempt to connect up to 3 times.

Generated using TypeDoc