콘텐츠로 건너뛰기

@capgo/capacitor-bluetooth-low-energy

Capacitor Bluetooth Low Energy Plugin for BLE communication.

Capacitor Bluetooth Low Energy Plugin for BLE communication.

  • initialize - Initialize the BLE plugin. Must be called before any other method.
  • shimWebBluetooth - Install the Capacitor Web Bluetooth shim on navigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.
  • isAvailable - Check if Bluetooth is available on the device.
  • isEnabled - Check if Bluetooth is enabled on the device.
MethodDescription
initializeInitialize the BLE plugin. Must be called before any other method.
shimWebBluetoothInstall the Capacitor Web Bluetooth shim on navigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.
isAvailableCheck if Bluetooth is available on the device.
isEnabledCheck if Bluetooth is enabled on the device.
isLocationEnabledCheck if location services are enabled (Android only).
openAppSettingsOpen the app settings page.
openBluetoothSettingsOpen the Bluetooth settings page (Android only).
openLocationSettingsOpen the location settings page (Android only).
checkPermissionsCheck the current permission status.
requestPermissionsRequest Bluetooth permissions.
startScanStart scanning for BLE devices.
stopScanStop scanning for BLE devices.
connectConnect to a BLE device.
disconnectDisconnect from a BLE device.
createBondCreate a bond with a BLE device (Android only).
isBondedCheck if a device is bonded (Android only).
discoverServicesDiscover services on a connected device.
getServicesGet discovered services for a device.
getConnectedDevicesGet a list of connected devices.
readCharacteristicRead a characteristic value.
writeCharacteristicWrite a value to a characteristic.
startCharacteristicNotificationsStart notifications for a characteristic.
stopCharacteristicNotificationsStop notifications for a characteristic.
readDescriptorRead a descriptor value.
writeDescriptorWrite a value to a descriptor.
readRssiRead the RSSI (signal strength) of a connected device.
requestMtuRequest MTU size change (Android only).
requestConnectionPriorityRequest connection priority (Android only).
startAdvertisingStart advertising as a peripheral (BLE server).
stopAdvertisingStop advertising.
startForegroundServiceStart a foreground service to maintain BLE connections in background (Android only).
stopForegroundServiceStop the foreground service (Android only).
getPluginVersionGet the native Capacitor plugin version.
addListenerAdd a listener for device scanned events.
addListenerAdd a listener for device connected events.
addListenerAdd a listener for device disconnected events.
addListenerAdd a listener for characteristic changed events.
removeAllListenersRemove all listeners for this plugin.

This reference is synced from src/definitions.ts in capacitor-bluetooth-low-energy.