Bluetooth Peripherals
Flutter ==> Bluetooth module
A BluetoothPeripheral
represents the profile of a BLE device that can be interacted with using the Validic Bluetooth Plugin. It contains information such as the manufacturer and model of the end user device.
Peripheral objects contain information regarding supported Bluetooth peripherals. Several function calls are provided to retrieve one or more peripherals.
A peripheral object contains various properties used during the reading and pairing process:
id
- Peripheral identifier.manufacturer
- Manufacturer name.model
- Model number.peripheralImageURL
- URL for an image of the peripheral.requiresPairing
- Boolean indicating if the peripheral requires pairing.pairingInstructions
- Text telling the user how to pair the peripheral, if the peripheral requires pairing.instructions
- Text telling the user how to initialize the reading process with the peripheral.readingInstructions
- Text telling the user what to do during the reading process.
Supported Peripherals
To get supported peripherals, call getSupportedPeripherals()
:
// Get a list of supported Bluetooth peripherals
List<BluetoothPeripheral> peripherals = await ValidicBluetooth.getSupportedPeripherals();
To get a specific peripheral:
// Get a specific peripheral by its ID
BluetoothPeripheral? peripheral = await ValidicBluetooth.getPeripheral(peripheralID);
Updated 1 day ago