checking in
This commit is contained in:
parent
2629192bdb
commit
82e34d852c
@ -1,5 +1,7 @@
|
|||||||
#include "pxt.h"
|
#include "pxt.h"
|
||||||
#include "MESEvents.h"
|
#include "MESEvents.h"
|
||||||
|
#include "MicroBitUARTService.h"
|
||||||
|
MicroBitUARTService *uart;
|
||||||
|
|
||||||
using namespace pxt;
|
using namespace pxt;
|
||||||
//% color=#0082FB weight=20
|
//% color=#0082FB weight=20
|
||||||
@ -78,5 +80,15 @@ namespace bluetooth {
|
|||||||
registerWithDal(MICROBIT_ID_BLE, MICROBIT_BLE_EVT_DISCONNECTED, body);
|
registerWithDal(MICROBIT_ID_BLE, MICROBIT_BLE_EVT_DISCONNECTED, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the Bluetooth UART service
|
||||||
|
*/
|
||||||
|
//% help=bluetooth/start-uart-service
|
||||||
|
//% blockId=bluetooth_start_uart_service block="bluetooth|uart|service" blockGap=8
|
||||||
|
|
||||||
|
void startUartService() {
|
||||||
|
// 32 octet buffer size is
|
||||||
|
uart = new MicroBitUARTService(*uBit.ble, 32, 32);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
7
libs/microbit-bluetooth/shims.d.ts
vendored
7
libs/microbit-bluetooth/shims.d.ts
vendored
@ -62,6 +62,13 @@ declare namespace bluetooth {
|
|||||||
//% help=bluetooth/on-bluetooth-disconnected
|
//% help=bluetooth/on-bluetooth-disconnected
|
||||||
//% blockId=bluetooth_on_disconnected block="on bluetooth disconnected" shim=bluetooth::onBluetoothDisconnected
|
//% blockId=bluetooth_on_disconnected block="on bluetooth disconnected" shim=bluetooth::onBluetoothDisconnected
|
||||||
function onBluetoothDisconnected(body: () => void): void;
|
function onBluetoothDisconnected(body: () => void): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the Bluetooth UART service
|
||||||
|
*/
|
||||||
|
//% help=bluetooth/start-uart-service
|
||||||
|
//% blockId=bluetooth_start_uart_service block="bluetooth|uart|service" blockGap=8 shim=bluetooth::startUartService
|
||||||
|
function startUartService(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-generated. Do not edit. Really.
|
// Auto-generated. Do not edit. Really.
|
||||||
|
Loading…
Reference in New Issue
Block a user