-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from robsonos/dev
Merge dev into main 🔀
- Loading branch information
Showing
22 changed files
with
1,015 additions
and
1,009 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ dist | |
example/www | ||
example/ios | ||
example/android | ||
example/.angular |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="com.example.plugin.nordicdfu"> | ||
|
||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" /> | ||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> | ||
|
||
<application> | ||
<service android:name=".DfuService"/> | ||
<activity android:name=".NotificationActivity"/> | ||
<service | ||
android:name=".DfuService" | ||
android:foregroundServiceType="connectedDevice" /> | ||
<activity android:name=".NotificationActivity" /> | ||
</application> | ||
|
||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> | ||
</manifest> |
2 changes: 0 additions & 2 deletions
2
android/src/main/java/com/example/plugin/nordicdfu/NordicDfu.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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { CapacitorConfig } from '@capacitor/cli'; | ||
|
||
const config: CapacitorConfig = { | ||
appId: 'com.example.plugin.nordicdfu', | ||
appName: 'example', | ||
webDir: 'www/browser', | ||
server: { | ||
androidScheme: 'https', | ||
}, | ||
}; | ||
|
||
export default config; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicModule } from '@ionic/angular'; | ||
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: 'app.component.html', | ||
styleUrls: ['app.component.scss'], | ||
standalone: true, | ||
imports: [IonicModule], | ||
imports: [IonApp, IonRouterOutlet], | ||
}) | ||
export class AppComponent {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-toolbar color="secondary"> | ||
<ion-buttons slot="start"> | ||
<ion-menu-button></ion-menu-button> | ||
</ion-buttons> | ||
<ion-title>Scan</ion-title> | ||
<ion-progress-bar *ngIf="scanProgress > 0" [value]="scanProgress"></ion-progress-bar> | ||
@if(scanProgress > 0){ | ||
<ion-progress-bar [value]="scanProgress"></ion-progress-bar> | ||
} | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<ion-button expand="block" [disabled]="bluetoothIsScanning" (click)="scanForBluetoothDevices()"> | ||
{{ bluetoothIsScanning ? "Scanning" : "Scan" }} | ||
</ion-button> | ||
<ion-refresher slot="fixed" #scanRefresher (ionRefresh)="scanForBluetoothDevices($event)"> | ||
<ion-refresher-content pullingText="Pull to scan" refreshingText="Scanning..."></ion-refresher-content> | ||
</ion-refresher> | ||
|
||
<ion-grid> | ||
<ion-list *ngIf="(scanResults$ | async) as scanResults; else noDevices"> | ||
@if(scanResults$ | async; as scanResults){ | ||
<ion-list> | ||
@for (scanResult of scanResults; track $index) { | ||
<ion-item | ||
*ngFor="let scanResult of scanResults" | ||
(click)="stopScanForBluetoothDevices()" | ||
[routerLink]="['/dfu']" | ||
[state]="{ device: scanResult}" | ||
lines="full" | ||
button | ||
> | ||
<ion-icon color="primary" slot="start" [src]="getRssiIcon(scanResult.rssi || -90)" size="large"></ion-icon> | ||
<ion-label> {{ scanResult.device.name || 'Unknown' }} </ion-label> | ||
<ion-note slot="end">{{ scanResult.rssi }} db</ion-note> | ||
</ion-item> | ||
</ion-list> | ||
<ng-template #noDevices> | ||
} @empty { | ||
<ion-note color="medium" class="ion-margin-horizontal">No devices found.</ion-note> | ||
</ng-template> | ||
} | ||
</ion-list> | ||
|
||
} @else { | ||
<ion-note color="medium" class="ion-margin-horizontal">Swipe down to scan for nearby Bluetooth devices.</ion-note> | ||
} | ||
</ion-grid> | ||
</ion-content> |
Oops, something went wrong.