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

@ -175,6 +175,10 @@ namespace pxsim.bluetooth {
export function uartReadUntil(del: string): string {
return serial.readUntil(del);
}
export function onDataReceived(delimiters: string, handler: RefAction) {
let b = board();
b.bus.listen(DAL.MICROBIT_ID_BLE_UART, DAL.MICROBIT_UART_S_EVT_DELIM_MATCH, handler);
}
export function onBluetoothConnected(a: RefAction) {
// TODO
}