2016-06-14 15:30:07 +02:00
|
|
|
// Auto-generated. Do not edit.
|
|
|
|
|
|
|
|
|
2016-06-21 23:30:05 +02:00
|
|
|
/**
|
|
|
|
* Support for additional Bluetooth services.
|
|
|
|
*/
|
2016-06-14 22:17:20 +02:00
|
|
|
//% color=#0082FB weight=20
|
2016-06-14 15:30:07 +02:00
|
|
|
declare namespace bluetooth {
|
|
|
|
|
|
|
|
/**
|
2016-06-20 09:39:51 +02:00
|
|
|
* Starts the Bluetooth IO pin service.
|
2016-06-14 15:30:07 +02:00
|
|
|
*/
|
2016-06-14 22:17:20 +02:00
|
|
|
//% help=bluetooth/start-io-pin-service
|
2016-06-14 22:47:18 +02:00
|
|
|
//% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service" blockGap=8 shim=bluetooth::startIOPinService
|
2016-06-14 15:30:07 +02:00
|
|
|
function startIOPinService(): void;
|
2016-06-14 22:17:20 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts the Bluetooth LED service
|
|
|
|
*/
|
|
|
|
//% help=bluetooth/start-led-service
|
2016-06-14 22:47:18 +02:00
|
|
|
//% blockId=bluetooth_start_led_service block="bluetooth led service" blockGap=8 shim=bluetooth::startLEDService
|
2016-06-14 22:17:20 +02:00
|
|
|
function startLEDService(): void;
|
2016-06-14 22:24:55 +02:00
|
|
|
|
|
|
|
/**
|
2016-06-20 09:39:51 +02:00
|
|
|
* Starts the Bluetooth temperature service
|
2016-06-14 22:24:55 +02:00
|
|
|
*/
|
2016-06-14 22:27:21 +02:00
|
|
|
//% help=bluetooth/start-temperature-service
|
2016-06-14 22:47:18 +02:00
|
|
|
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" blockGap=8 shim=bluetooth::startTemperatureService
|
2016-06-14 22:24:55 +02:00
|
|
|
function startTemperatureService(): void;
|
2016-06-14 22:39:24 +02:00
|
|
|
|
|
|
|
/**
|
2016-06-20 09:39:51 +02:00
|
|
|
* Starts the Bluetooth magnetometer service
|
2016-06-14 22:39:24 +02:00
|
|
|
*/
|
|
|
|
//% help=bluetooth/start-magnetometer-service
|
2016-06-14 22:47:18 +02:00
|
|
|
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service" blockGap=8 shim=bluetooth::startMagnetometerService
|
2016-06-14 22:39:24 +02:00
|
|
|
function startMagnetometerService(): void;
|
2016-06-14 22:47:18 +02:00
|
|
|
|
|
|
|
/**
|
2016-06-20 09:39:51 +02:00
|
|
|
* Starts the Bluetooth accelerometer service
|
2016-06-14 22:47:18 +02:00
|
|
|
*/
|
|
|
|
//% help=bluetooth/start-accelerometer-service
|
|
|
|
//% blockId=bluetooth_start_accelerometer_service block="bluetooth accelerometer service" blockGap=8 shim=bluetooth::startAccelerometerService
|
|
|
|
function startAccelerometerService(): void;
|
2016-06-14 22:53:05 +02:00
|
|
|
|
|
|
|
/**
|
2016-06-20 09:39:51 +02:00
|
|
|
* Starts the Bluetooth button service
|
2016-06-14 22:53:05 +02:00
|
|
|
*/
|
|
|
|
//% help=bluetooth/start-button-service
|
|
|
|
//% blockId=bluetooth_start_button_service block="bluetooth button service" blockGap=8 shim=bluetooth::startButtonService
|
|
|
|
function startButtonService(): void;
|
2016-06-20 09:39:51 +02:00
|
|
|
|
2016-08-09 17:05:25 +02:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
|
2016-06-24 08:59:08 +02:00
|
|
|
/**
|
|
|
|
* Writes to the Bluetooth UART service buffer. From there the data is transmitted over Bluetooth to a connected device.
|
|
|
|
*/
|
|
|
|
//% help=bluetooth/uart-write
|
2016-06-24 09:46:05 +02:00
|
|
|
//% blockId=bluetooth_uart_write block="bluetooth uart write %data" blockGap=8 shim=bluetooth::uartWrite
|
2016-06-24 08:59:08 +02:00
|
|
|
function uartWrite(data: string): void;
|
|
|
|
|
2016-06-24 09:46:05 +02:00
|
|
|
/**
|
|
|
|
* Reads from the Bluetooth UART service buffer, returning its contents when the specified delimiter character is encountered.
|
|
|
|
*/
|
|
|
|
//% help=bluetooth/uart-read
|
2016-06-24 17:12:52 +02:00
|
|
|
//% blockId=bluetooth_uart_read block="bluetooth uart read %del=bluetooth_uart_delimiter_conv" blockGap=8 shim=bluetooth::uartRead
|
2016-06-24 09:46:05 +02:00
|
|
|
function uartRead(del: string): string;
|
|
|
|
|
2016-06-24 17:12:52 +02:00
|
|
|
/**
|
|
|
|
* Returns the delimiter corresponding string
|
|
|
|
*/
|
|
|
|
//% blockId="bluetooth_uart_delimiter_conv" block="%del"
|
|
|
|
//% weight=1 shim=bluetooth::delimiters
|
|
|
|
function delimiters(del: Delimiters): string;
|
|
|
|
|
2016-06-20 09:39:51 +02:00
|
|
|
/**
|
|
|
|
* Register code to run when the micro:bit is connected to over Bluetooth
|
|
|
|
* @param body Code to run when a Bluetooth connection is established
|
|
|
|
*/
|
2016-06-24 17:12:52 +02:00
|
|
|
//% help=bluetooth/on-bluetooth-connected weight=20
|
|
|
|
//% blockId=bluetooth_on_connected block="on bluetooth connected" blockGap=8 shim=bluetooth::onBluetoothConnected
|
2016-06-20 09:39:51 +02:00
|
|
|
function onBluetoothConnected(body: () => void): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register code to run when a bluetooth connection to the micro:bit is lost
|
|
|
|
* @param body Code to run when a Bluetooth connection is lost
|
|
|
|
*/
|
2016-06-24 17:12:52 +02:00
|
|
|
//% help=bluetooth/on-bluetooth-disconnected weight=19
|
2016-06-20 09:39:51 +02:00
|
|
|
//% blockId=bluetooth_on_disconnected block="on bluetooth disconnected" shim=bluetooth::onBluetoothDisconnected
|
|
|
|
function onBluetoothDisconnected(body: () => void): void;
|
2016-06-14 15:30:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Auto-generated. Do not edit. Really.
|