merging ble changes

This commit is contained in:
Peli de Halleux
2016-10-18 21:55:02 -07:00
18 changed files with 305 additions and 175 deletions

View File

@ -168,7 +168,7 @@ namespace pxsim.bluetooth {
export function uartWrite(s : string): void {
// TODO
}
export function uartRead(): string {
export function uartReadUntil(del: string): string {
// TODO
return ""
}

View File

@ -43,6 +43,10 @@ namespace pxsim.serial {
return board().serialState.readSerial();
}
export function readUntil(del: string): string {
return readLine();
}
export function onDataReceived(delimiters: string, handler: RefAction) {
let b = board();
b.bus.listen(DAL.MICROBIT_ID_SERIAL, DAL.MICROBIT_SERIAL_EVT_DELIM_MATCH, handler);