-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Bluetooth Low Energy plugin (#802)
* feat: add Bluetooth Low Energy plugin * wip * wip
- Loading branch information
Showing
27 changed files
with
655 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
.../app/src/main/java/dev/robingenz/capacitor/plugindemo/BluetoothLowEnergyHeadlessTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dev.robingenz.capacitor.plugindemo; | ||
|
||
import android.bluetooth.BluetoothGatt; | ||
import android.bluetooth.BluetoothGattCharacteristic; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.getcapacitor.Logger; | ||
|
||
public class BluetoothLowEnergyHeadlessTask { | ||
public void onCharacteristicChanged(@NonNull BluetoothGatt gatt, @NonNull BluetoothGattCharacteristic characteristic, @NonNull byte[] value) { | ||
Logger.debug("BluetoothLowEnergyHeadlessTask", "Characteristic changed: " + characteristic.getUuid().toString() + " Value: " + value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...uetooth-low-energy/bluetooth-low-energy-device/bluetooth-low-energy-device.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Device</ion-title> | ||
<ion-buttons slot="end"> | ||
<ion-button (click)="closeModal()"> | ||
<ion-icon name="close"></ion-icon> | ||
</ion-button> | ||
</ion-buttons> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<ion-card> | ||
<ion-card-header> | ||
<ion-card-title>{{ device?.name || device?.id }}</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
<ion-button expand="block" (click)="connect()">Connect</ion-button> | ||
<ion-button expand="block" (click)="createBond()">Create Bond</ion-button> | ||
<ion-button expand="block" (click)="disconnect()">Disconnect</ion-button> | ||
<ion-button expand="block" (click)="discoverServices()" | ||
>Discover Service</ion-button | ||
> | ||
<ion-button expand="block" (click)="getServices()" | ||
>Get Services</ion-button | ||
> | ||
<ion-button expand="block" (click)="isBonded()">Is Bonded</ion-button> | ||
<ion-button expand="block" (click)="readCharacteristic()" | ||
>Read Characteristic</ion-button | ||
> | ||
<ion-button expand="block" (click)="readRssi()">Read Rssi</ion-button> | ||
<ion-button expand="block" (click)="requestConnectionPriority()" | ||
>Request Connection Priority</ion-button | ||
> | ||
<ion-button expand="block" (click)="requestMtu()">Request Mtu</ion-button> | ||
<ion-button expand="block" (click)="startCharacteristicNotifications()" | ||
>Start Characteristic Notifications</ion-button | ||
> | ||
<ion-button expand="block" (click)="stopCharacteristicNotifications()" | ||
>Stop Characteristic Notifications</ion-button | ||
> | ||
<ion-button expand="block" (click)="writeCharacteristic()" | ||
>Write Characteristic</ion-button | ||
> | ||
</ion-card-content> | ||
</ion-card> | ||
</ion-content> |
Empty file.
Oops, something went wrong.