Skip to content

Commit f3ed0b9

Browse files
Exploring integrating capacitor ble code
Doesn't yet compile. Just aligning some of the types / interfaces first. This might ultimately belong in microbit-connection but it's easier to explore here against the real requirements and UX needs.
1 parent d47f637 commit f3ed0b9

15 files changed

+1640
-4
lines changed

package-lock.json

Lines changed: 130 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,17 @@
5858
"vitest-dom": "^0.1.1"
5959
},
6060
"dependencies": {
61+
"@capacitor-community/bluetooth-le": "^7.3.0",
6162
"@capacitor-community/safe-area": "^7.0.0-beta.5",
6263
"@capacitor/android": "^7.4.4",
6364
"@capacitor/core": "^7.4.4",
65+
"@capacitor/filesystem": "^7.1.5",
6466
"@capacitor/ios": "^7.4.4",
6567
"@chakra-ui/icons": "^2.1.1",
6668
"@chakra-ui/react": "^2.8.2",
6769
"@emotion/react": "^11.11.4",
6870
"@emotion/styled": "^11.11.5",
71+
"@microbit/capacitor-community-nordic-dfu": "^7.0.0-microbit.3",
6972
"@microbit/makecode-embed": "^0.3.0",
7073
"@microbit/microbit-connection": "^0.0.0-alpha.39",
7174
"@microbit/ml-header-generator": "^0.4.3",
@@ -76,10 +79,12 @@
7679
"bowser": "^2.11.0",
7780
"chart.js": "^4.2.1",
7881
"framer-motion": "^10.2.4",
82+
"jszip": "^3.10.1",
7983
"lodash.camelcase": "^4.3.0",
8084
"lodash.debounce": "^4.0.8",
8185
"lodash.upperfirst": "^4.3.1",
8286
"ml4f": "git://github.com/microsoft/ml4f#v1.10.1",
87+
"nrf-intel-hex": "^1.4.0",
8388
"react": "^18.3.1",
8489
"react-dom": "^18.3.1",
8590
"react-hotkeys-hook": "^4.6.1",

src/connect-actions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
import { ConnectionType } from "./connection-stage-hooks";
2020
import { HexType, getFlashDataSource } from "./device/get-hex-file";
2121
import { Logging } from "./logging/logging";
22+
import { MicrobitCapacitorBluetoothConnection } from "./device/capacitor-ble";
2223

2324
export enum ConnectResult {
2425
Success = "Success",
@@ -62,7 +63,9 @@ export class ConnectActions {
6263
constructor(
6364
private logging: Logging,
6465
private usb: MicrobitWebUSBConnection,
65-
private bluetooth: MicrobitWebBluetoothConnection,
66+
private bluetooth:
67+
| MicrobitWebBluetoothConnection
68+
| MicrobitCapacitorBluetoothConnection,
6669
private radioBridge: MicrobitRadioBridgeConnection,
6770
private radioRemoteBoardVersion: React.MutableRefObject<
6871
BoardVersion | undefined

0 commit comments

Comments
 (0)