Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HotspotBleManager

Use this interface to connect to and interact with a Hotspot over bluetooth.

For example if you wanted to scan for hotspots in one of your components you would first need to wrap your apps root component with HotspotBleProvider (see the example app).

Next in the component you want to scan for hotspots, you would add the following code to import the functions from the BleManager:

const { startScan, stopScan, connect, scannedDevices } = useHotspotBle()

See the example app for a working demo of scanning for Hotspots.

Hierarchy

  • HotspotBleManager

Index

Properties

scannedDevices

scannedDevices: Device[]

The list of Hotspot devices scanned by startScan.

Methods

checkFirmwareCurrent

  • checkFirmwareCurrent(minVersion: string): Promise<{ current: boolean; deviceFirmwareVersion: string; minVersion: string }>
  • Check if the connected Hotspots firmware is up to date.

    Parameters

    • minVersion: string

    Returns Promise<{ current: boolean; deviceFirmwareVersion: string; minVersion: string }>

connect

  • connect(hotspotDevice: Device): Promise<void>

createAndSignGatewayTxn

  • createAndSignGatewayTxn(opts: { ownerAddress: string; ownerKeypairRaw: SodiumKeyPair; payerAddress: string }): Promise<undefined | AddGatewayV1>

createGatewayTxn

  • createGatewayTxn(opts: { ownerAddress: string; payerAddress: string }): Promise<string>
  • Create an Add Gateway Transaction for the connected Device.

    Parameters

    • opts: { ownerAddress: string; payerAddress: string }
      • ownerAddress: string
      • payerAddress: string

    Returns Promise<string>

disconnect

  • disconnect(): void

enable

  • enable(): Promise<boolean>
  • Enable Bluetooth on the device. This function blocks until BLE is in PoweredOn state. [Android only]

    Returns Promise<boolean>

getDiagnosticInfo

getOnboardingAddress

  • getOnboardingAddress(): Promise<string>

getState

  • getState(): Promise<State>

isConnected

  • isConnected(): Promise<boolean>

readWifiNetworks

  • readWifiNetworks(configured: boolean): Promise<undefined | string[]>
  • Returns the list of Wifi Networks the connected Hotspot can detect.

    Parameters

    • configured: boolean

    Returns Promise<undefined | string[]>

removeConfiguredWifi

  • removeConfiguredWifi(name: string): Promise<undefined | string>
  • Removes the saved Wifi configuration from the connected Hotspot.

    Parameters

    • name: string

    Returns Promise<undefined | string>

resetDevices

  • resetDevices(): void

setWifi

  • setWifi(ssid: string, password: string): Promise<"connected" | "invalid" | "not_found">
  • Saves and connects a Wifi network to the connected Hotspot.

    Parameters

    • ssid: string
    • password: string

    Returns Promise<"connected" | "invalid" | "not_found">

startScan

  • startScan(callback: (error: null | BleError) => void): Promise<void>

stopScan

  • stopScan(): void

Generated using TypeDoc