Capacitor Bluetooth Low Energy 플러그인에 대한 더 많은 정보를 보려면 Cloudflare에 가십시오.
Capacitor Bluetooth Low Energy 플러그인 사용 가이드
Using @capgo/capacitor-bluetooth-low-energy
Capacitor 블루투스 저전력 에너지 플러그인 BLE 통신을 위해
설치
bun add @capgo/capacitor-bluetooth-low-energy
bunx cap sync
이 플러그인이 제공하는 것
initialize- BLE 플러그인을 초기화합니다. 다른 메서드를 호출하기 전에 반드시 호출해야 합니다.shimWebBluetooth- Capacitor 웹 블루투스 시뮬레이터를 Capacitor에 설치합니다.navigator.bluetooth- 웹 블루투스 API를 사용하기 전에 Capacitor 네이티브 앱에서 API를 호출합니다.isAvailable- 장치에서 블루투스가 사용 가능한지 확인합니다.isEnabled- 장치에서 블루투스가 활성화되어 있는지 확인합니다.
예제 사용
initialize
블루투스 저전력 에너지 플러그인을 초기화합니다. 다른 메서드를 호출하기 전에 반드시 호출해야 합니다.
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
await BluetoothLowEnergy.initialize({ mode: 'central' });
shimWebBluetooth
Web Bluetooth shim을 Capacitor에 설치하세요. Web Bluetooth shim을 수동으로 호출하여 __CAPGO_KEEP_1__ 네이티브 앱에서 Web Bluetooth shim을 사용하기 전에 호출하세요. navigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
BluetoothLowEnergy.shimWebBluetooth();
isAvailable
디바이스에서 블루투스를 활성화했는지 확인합니다.
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
const { available } = await BluetoothLowEnergy.isAvailable();
isEnabled
전체 참조
import { BluetoothLowEnergy } from '@capgo/capacitor-bluetooth-low-energy';
const { enabled } = await BluetoothLowEnergy.isEnabled();
__CAPGO_KEEP_0__:
- https://GitHub.com/Cap-go/__CAPGO_KEEP_1__-bluetooth-low-energy/ https://github.com/Cap-go/capacitor-bluetooth-low-energy/
- Using @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-bluetooth-low-energy
Keep going from Using @capgo/capacitor-bluetooth-low-energy
Using @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-bluetooth-low-energy Using @capgo/capacitor-bluetooth-low-energy native 플러그인 작업을 계획하기 위해 연결하세요. @capgo/capacitor-블루투스 저전력 for the implementation detail in @capgo/capacitor-bluetooth-low-energy, 시작하기 시작하기의 구현 세부 사항 Capgo 플러그인 디렉토리 Capgo 플러그인 디렉토리의 제품 워크플로우 Capacitor 플러그인들 - Capgo Capacitor-블루투스 저전력의 구현 세부 사항, Capacitor 플러그인들 - Capgo 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트의 구현 세부 사항