diff --git a/docs/reference/bluetooth/uart-write-string.md b/docs/reference/bluetooth/uart-write-string.md index aa368f99..ffd10579 100644 --- a/docs/reference/bluetooth/uart-write-string.md +++ b/docs/reference/bluetooth/uart-write-string.md @@ -1,4 +1,4 @@ -# UART Write Number +# UART Write String ### ~hint ![](/static/bluetooth/Bluetooth_SIG.png) diff --git a/libs/bluetooth/bluetooth.ts b/libs/bluetooth/bluetooth.ts index f5630ddd..3f480408 100644 --- a/libs/bluetooth/bluetooth.ts +++ b/libs/bluetooth/bluetooth.ts @@ -6,7 +6,7 @@ namespace bluetooth { /** * Writes to the Bluetooth UART service buffer. From there the data is transmitted over Bluetooth to a connected device. */ - //% help=bluetooth/uart-write weight=80 + //% help=bluetooth/uart-write-string weight=80 //% blockId=bluetooth_uart_write block="bluetooth uart|write string %data" blockGap=8 //% parts="bluetooth" shim=bluetooth::uartWriteString advanced=true export function uartWriteString(data: string): void { @@ -17,7 +17,7 @@ namespace bluetooth { /** * Prints a numeric value to the serial */ - //% help=serial/write-number weight=79 + //% help=bluetooth/uart-write-number weight=79 //% weight=89 blockGap=8 advanced=true //% blockId=bluetooth_uart_writenumber block="bluetooth uart|write number %value" export function uartWriteNumber(value: number): void { diff --git a/sim/state/serial.ts b/sim/state/serial.ts index ff4f9420..5f6e1b4d 100644 --- a/sim/state/serial.ts +++ b/sim/state/serial.ts @@ -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);