개요
“개요” 섹션Bluetooth 기기 스캔, 연결, 읽기, 쓰기, 알림 수신을 위한 모든 기능을 갖춘 BLE 플러그인
시작하기 initialize() 그리고 아래에 나열된 다른 핵심 메서드도 살펴보세요.
플랫폼 지원
“플랫폼 지원” 섹션| 플랫폼 | 지원 | 참고 사항 |
|---|---|---|
| iOS | 지원 | 네이티브 |
| Android | 지원 | 네이티브 |
| 웹 | 아니요 | Capacitor.getPlatform()으로 보호하세요 |
핵심 기능
“핵심 기능” 섹션initialize- BLE 플러그인을 초기화합니다. 다른 메서드를 호출하기 전에 반드시 먼저 호출해야 합니다.shimWebBluetooth- Capacitor Web Bluetooth shim을 설치하세요.navigator.bluetooth. Capacitor 네이티브 앱에서 Web Bluetooth API를 사용하기 전에 직접 호출하세요.isAvailable- 기기에 Bluetooth가 사용 가능한지 확인합니다.isEnabled- 기기에 Bluetooth가 활성화되어 있는지 확인합니다.
공개 API
“Public API” 섹션| 메서드 | 설명 |
|---|---|
initialize | BLE 플러그인을 초기화합니다. 다른 메서드를 호출하기 전에 반드시 실행해야 합니다. |
shimWebBluetooth | Capacitor Web Bluetooth shim을 다음에 설치합니다 navigator.bluetooth. Capacitor 네이티브 앱에서 Web Bluetooth API를 사용하기 전에 직접 호출하세요. |
isAvailable | 기기에서 Bluetooth를 사용할 수 있는지 확인합니다. |
isEnabled | 기기의 Bluetooth 활성화 여부를 확인합니다. |
isLocationEnabled | 위치 서비스 활성화 여부를 확인합니다 (Android 전용). |
openAppSettings | 앱 설정 페이지를 엽니다. |
openBluetoothSettings | Bluetooth 설정 페이지를 엽니다 (Android 전용). |
openLocationSettings | 위치 설정 페이지를 엽니다 (Android 전용). |
checkPermissions | 현재 권한 상태를 확인합니다. |
requestPermissions | Bluetooth 권한을 요청합니다. |
startScan | BLE 디바이스 스캔 시작. |
stopScan | BLE 디바이스 스캔 중지. |
connect | BLE 디바이스에 연결. |
disconnect | BLE 디바이스 연결 해제. |
createBond | BLE 기기와 본딩합니다 (Android 전용). |
isBonded | 기기가 본딩되었는지 확인합니다 (Android 전용). |
discoverServices | 연결된 기기에서 서비스를 검색합니다. |
getServices | 기기에서 검색된 서비스 목록을 가져옵니다. |
getConnectedDevices | 연결된 디바이스 목록을 가져옵니다. |
readCharacteristic | Characteristic 값을 읽습니다. |
writeCharacteristic | Characteristic에 값을 씁니다. |
startCharacteristicNotifications | Characteristic 알림을 시작합니다. |
stopCharacteristicNotifications | characteristic의 알림을 중지합니다. |
readDescriptor | descriptor 값을 읽습니다. |
writeDescriptor | descriptor에 값을 씁니다. |
readRssi | 연결된 장치의 RSSI(신호 강도)를 읽습니다. |
requestMtu | MTU 크기 변경을 요청합니다 (Android 전용). |
requestConnectionPriority | 연결 우선순위를 요청합니다 (Android 전용). |
startAdvertising | Peripheral(BLE server)로 advertising을 시작합니다. |
stopAdvertising | Advertising을 중지합니다. |
startForegroundService | 백그라운드에서 BLE 연결을 유지하기 위해 포그라운드 서비스를 시작합니다 (Android 전용). |
stopForegroundService | 포그라운드 서비스를 중지합니다 (Android 전용). |
getPluginVersion | 네이티브 Capacitor 플러그인 버전을 가져옵니다. |
addListener | 디바이스 스캔 이벤트 리스너를 추가합니다. |
addListener | 디바이스 연결 이벤트 리스너를 추가합니다. |
addListener | 디바이스 연결 해제 이벤트 리스너를 추가합니다. |
addListener | Characteristic 변경 이벤트 리스너를 추가합니다. |
removeAllListeners | 이 플러그인의 모든 리스너를 제거합니다. |
Source of Truth
“Source Of Truth” 섹션이 레퍼런스는 다음에서 동기화됩니다. src/definitions.ts 에서 capacitor-bluetooth-low-energy.
@capgo/capacitor-bluetooth-low-energy에서 계속하기
“@capgo/capacitor-bluetooth-low-energy에서 계속하기” 섹션사용 중이라면 @capgo/capacitor-bluetooth-low-energy 마이그레이션과 엔터프라이즈 운영을 계획하려면 다음과 연결하세요: @capgo/capacitor-bluetooth-low-energy 사용하기 @capgo/capacitor-bluetooth-low-energy 사용하기의 네이티브 기능을 위한, Capgo 엔터프라이즈 Capgo Enterprise의 제품 워크플로우를 위해, Ionic Enterprise 플러그인 대안 Ionic Enterprise 플러그인 대안의 제품 워크플로우를 위해, Capgo 대안 Capgo 대안의 제품 워크플로우를 위해, 그리고 Capgo 컨설팅 Capgo Consulting의 제품 워크플로우를 위해.