BLE UART Buffer methods (#1353)

* adding simulator

* attempt at handling size

* correct ref counting

* defense is on

* handle read < 0
This commit is contained in:
Peli de Halleux
2018-10-05 15:25:18 -07:00
committed by GitHub
parent c14108de99
commit f2435df722
4 changed files with 56 additions and 0 deletions

View File

@ -208,6 +208,15 @@ namespace pxsim.bluetooth {
export function uartWriteString(s: string): void {
serial.writeString(s)
}
export function uartWriteBuffer(b: RefBuffer): void {
serial.writeBuffer(b);
}
export function uartReadBuffer(): RefBuffer {
return pins.createBuffer(0);
}
export function uartReadUntil(del: string): string {
return serial.readUntil(del);
}