Uartevent (#393)

* support for uart data event

* updated shims
This commit is contained in:
Peli de Halleux
2017-04-28 01:05:04 -07:00
committed by GitHub
parent f820c20af8
commit 9af989c13c
7 changed files with 49 additions and 0 deletions

View File

@ -63,6 +63,14 @@ declare namespace bluetooth {
//% parts="bluetooth" advanced=true shim=bluetooth::startUartService
function startUartService(): void;
/**
* Registers an event to be fired when one of the delimiter is matched.
* @param delimiters the characters to match received characters against.
*/
//% help=bluetooth/on-uart-data-received
//% weight=18 blockId=bluetooth_on_data_received block="bluetooth|on data received %delimiters=serial_delimiter_conv" shim=bluetooth::onUartDataReceived
function onUartDataReceived(delimiters: string, body: () => void): void;
/**
* Register code to run when the micro:bit is connected to over Bluetooth
* @param body Code to run when a Bluetooth connection is established