Pairing documentation worj in progress. UART write block added

This commit is contained in:
Martin Woolley
2016-06-24 07:59:08 +01:00
parent f068b3d204
commit 0834402b18
4 changed files with 133 additions and 60 deletions

View File

@ -49,6 +49,20 @@ declare namespace bluetooth {
//% blockId=bluetooth_start_button_service block="bluetooth button service" blockGap=8 shim=bluetooth::startButtonService
function startButtonService(): void;
/**
* Starts the Bluetooth UART service
*/
//% help=bluetooth/start-uart-service
//% blockId=bluetooth_start_uart_service block="bluetooth uart service" blockGap=8 shim=bluetooth::startUartService
function startUartService(): void;
/**
* Writes to the Bluetooth UART service buffer. From there the data is transmitted over Bluetooth to a connected device.
*/
//% help=bluetooth/uart-write
//% blockId=bluetooth_uart_write block="bluetooth|uart|write %data" blockGap=8 shim=bluetooth::uartWrite
function uartWrite(data: string): 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
@ -64,28 +78,6 @@ declare namespace bluetooth {
//% help=bluetooth/on-bluetooth-disconnected
//% blockId=bluetooth_on_disconnected block="on bluetooth disconnected" shim=bluetooth::onBluetoothDisconnected
function onBluetoothDisconnected(body: () => void): void;
/**
* Starts the Bluetooth UART service
*/
//% help=bluetooth/start-uart-service
//% blockId=bluetooth_start_uart_service block="bluetooth|uart|service" blockGap=8 shim=bluetooth::startUartService
function startUartService(): void;
/**
* Reads the Bluetooth UART service buffer, returning when a specified 'end of message' delimiter character is encountered
* @param eom End of Message delimiter character
*/
//% help=bluetooth/uart-read
//% blockId=bluetooth_uart_read block="bluetooth|uart|read %eom" blockGap=8 shim=bluetooth::uartRead
function uartRead(eom: char*): string;
/**
* Writes to the Bluetooth UART service buffer. From there the data is transmitted over Bluetooth to a connected device.
*/
//% help=bluetooth/uart-write
//% blockId=bluetooth_uart_write block="bluetooth|uart|write %data" blockGap=8 shim=bluetooth::uartWrite
function uartWrite(data: string): void;
}
// Auto-generated. Do not edit. Really.