안내서
블루투스 저전력 에너지 사용 설명서
Using @capgo/capacitor-bluetooth-low-energy
Capacitor 블루투스 저전력 에너지 플러그인
설치
bun add @capgo/capacitor-bluetooth-low-energy
bunx cap sync
이 플러그인이 제공하는 것
initialize- BLE 플러그인을 초기화합니다. 다른 메서드를 호출하기 전에 반드시 호출해야 합니다.shimWebBluetooth- Capacitor 웹 블루투스 시뮬레이터를 설치합니다.navigator.bluetooth이것을 수동으로 호출하여 Capacitor 네이티브 앱에서 웹 블루투스 API를 사용하기 전에 호출해야 합니다.isAvailable- __CAPGO_KEEP_0__이 장치에 사용 가능한지 확인합니다.isEnabled- 장치에서 __CAPGO_KEEP_0__가 활성화되어 있는지 확인합니다.
Example Usage
initialize
BLE 플러그인을 초기화합니다. 다른 메서드를 호출하기 전에 반드시 호출해야 합니다.
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
await BluetoothLowEnergy.initialize({ mode: 'central' });
shimWebBluetooth
Capacitor Web Bluetooth shim을 설치합니다. navigator.bluetooth. Capacitor 네이티브 앱에서 Web Bluetooth API를 사용하기 전에 수동으로 호출하세요.
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
BluetoothLowEnergy.shimWebBluetooth();
isAvailable
__CAPGO_KEEP_0__이 장치에 사용 가능한지 확인합니다.
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
const { available } = await BluetoothLowEnergy.isAvailable();
isEnabled
__CAPGO_KEEP_0__가 장치에서 활성화되어 있는지 확인합니다.
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
const { enabled } = await BluetoothLowEnergy.isEnabled();
Full Reference
- GitHub: https://github.com/Cap-go/capacitor-bluetooth-low-energy/
- Docs: /docs/plugins/bluetooth-low-energy/