The options object passed into the connect function.

interface ConnectOptions {
    UUID: string;
    auto2MegPhy?: boolean;
    autoDiscoverAll?: boolean;
    autoMaxMTU?: boolean;
    onConnected?: ((data) => void);
    onDisconnected?: ((data) => void);
    priority?: number;
    serviceUUIDs?: string[];
    transport?: number;
}

Properties

UUID: string

The UUID of the peripheral to connect to.

auto2MegPhy?: boolean

Selects 2M PHY when available (Android only)

autoDiscoverAll?: boolean

Discover all services on connection. Default is false for faster connection

autoMaxMTU?: boolean

Selects maximum BLE MTU (247) (Android only)

onConnected?: ((data) => void)

Once the peripheral is connected this callback function is invoked.

Type declaration

    • (data): void
    • Once the peripheral is connected this callback function is invoked.

      Parameters

      • data: {
            UUID: any;
            advertismentData: AdvertismentData;
            name: string;
            services?: Service[];
            state: ConnectionState;
        }

      Returns void

onDisconnected?: ((data) => void)

Once the peripheral is disconnected this callback function is invoked.

Type declaration

    • (data): void
    • Once the peripheral is disconnected this callback function is invoked.

      Parameters

      • data: {
            UUID: any;
            name: string;
        }
        • UUID: any
        • name: string

      Returns void

priority?: number
serviceUUIDs?: string[]

Discover specified services on connection

transport?: number

transport selection (Android only)

Generated using TypeDoc