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 .
* /
2017-09-19 23:54:46 +02:00
//% color=#0082FB weight=96 icon="\uf294"
2016-06-14 15:30:07 +02:00
declare namespace bluetooth {
2016-10-19 06:36:42 +02:00
/ * *
* Starts the Bluetooth accelerometer service
* /
//% help=bluetooth/start-accelerometer-service
//% blockId=bluetooth_start_accelerometer_service block="bluetooth accelerometer service"
//% parts="bluetooth" weight=90 blockGap=8 shim=bluetooth::startAccelerometerService
function startAccelerometerService ( ) : void ;
/ * *
* Starts the Bluetooth button service
* /
//% help=bluetooth/start-button-service
//% blockId=bluetooth_start_button_service block="bluetooth button service" blockGap=8
//% parts="bluetooth" weight=89 shim=bluetooth::startButtonService
function startButtonService ( ) : void ;
2016-06-14 15:30:07 +02:00
/ * *
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-08-22 17:48:48 +02:00
//% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service" blockGap=8
2016-10-19 06:36:42 +02:00
//% parts="bluetooth" weight=88 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-08-22 17:48:48 +02:00
//% blockId=bluetooth_start_led_service block="bluetooth led service" blockGap=8
2016-10-19 06:36:42 +02:00
//% parts="bluetooth" weight=87 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-08-22 17:48:48 +02:00
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" blockGap=8
2016-10-19 06:36:42 +02:00
//% parts="bluetooth" weight=86 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-10-19 06:36:42 +02:00
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service"
//% parts="bluetooth" weight=85 shim=bluetooth::startMagnetometerService
2016-06-14 22:39:24 +02:00
function startMagnetometerService ( ) : void ;
2016-06-14 22:47:18 +02:00
2016-08-09 17:10:53 +02:00
/ * *
* Starts the Bluetooth UART service
* /
//% help=bluetooth/start-uart-service
2016-10-19 06:36:42 +02:00
//% blockId=bluetooth_start_uart_service block="bluetooth uart service"
//% parts="bluetooth" advanced=true shim=bluetooth::startUartService
2016-08-09 17:10:53 +02:00
function startUartService ( ) : void ;
2019-12-02 05:58:26 +01:00
/ * *
* Sends a buffer of data via Bluetooth UART
* /
//% shim=bluetooth::uartWriteBuffer
function uartWriteBuffer ( buffer : Buffer ) : void ;
/ * *
* Reads buffered UART data into a buffer
* /
//% shim=bluetooth::uartReadBuffer
function uartReadBuffer ( ) : Buffer ;
2017-09-19 23:54:46 +02:00
/ * *
* Registers an event to be fired when one of the delimiter is matched .
* @param delimiters the characters to match received characters against .
* /
//% help=bluetooth/on-uart-data-received
//% weight=18 blockId=bluetooth_on_data_received block="bluetooth|on data received %delimiters=serial_delimiter_conv" shim=bluetooth::onUartDataReceived
function onUartDataReceived ( delimiters : string , body : ( ) = > void ) : void ;
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
2016-08-22 17:48:48 +02:00
//% blockId=bluetooth_on_connected block="on bluetooth connected" blockGap=8
//% parts="bluetooth" 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-08-22 17:48:48 +02:00
//% blockId=bluetooth_on_disconnected block="on bluetooth disconnected"
//% parts="bluetooth" shim=bluetooth::onBluetoothDisconnected
2016-06-20 09:39:51 +02:00
function onBluetoothDisconnected ( body : ( ) = > void ) : void ;
2017-09-19 23:54:46 +02:00
/ * *
* Advertise an Eddystone URL
* @param url the url to transmit . Must be no longer than the supported eddystone url length , eg : "https://makecode.com"
* @param power power level between 0 and 7 , eg : 7
* @param connectable true to keep bluetooth connectable for other services , false otherwise .
* /
//% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power|connectable %connectable"
//% parts=bluetooth weight=11 blockGap=8
2022-03-22 17:36:19 +01:00
//% help=bluetooth/advertise-url blockExternalInputs=1
//% hidden=1 deprecated=1 shim=bluetooth::advertiseUrl
2019-12-02 05:58:26 +01:00
function advertiseUrl ( url : string , power : int32 , connectable : boolean ) : void ;
2017-09-19 23:54:46 +02:00
/ * *
* Advertise an Eddystone UID
* @param nsAndInstance 16 bytes buffer of namespace ( bytes 0 - 9 ) and instance ( bytes 10 - 15 )
* @param power power level between 0 and 7 , eg : 7
* @param connectable true to keep bluetooth connectable for other services , false otherwise .
* /
2022-03-22 17:36:19 +01:00
//% parts=bluetooth weight=12 advanced=true deprecated=1 shim=bluetooth::advertiseUidBuffer
2019-12-02 05:58:26 +01:00
function advertiseUidBuffer ( nsAndInstance : Buffer , power : int32 , connectable : boolean ) : void ;
2017-09-19 23:54:46 +02:00
/ * *
* Sets the bluetooth transmit power between 0 ( minimal ) and 7 ( maximum ) .
* @param power power level between 0 ( minimal ) and 7 ( maximum ) , eg : 7.
* /
//% parts=bluetooth weight=5 help=bluetooth/set-transmit-power advanced=true
//% blockId=bluetooth_settransmitpower block="bluetooth set transmit power %power" shim=bluetooth::setTransmitPower
2019-12-02 05:58:26 +01:00
function setTransmitPower ( power : int32 ) : void ;
2017-09-19 23:54:46 +02:00
/ * *
* Stops advertising Eddystone end points
* /
//% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
//% parts=bluetooth weight=10
2022-03-22 17:36:19 +01:00
//% help=bluetooth/stop-advertising advanced=true
//% hidden=1 deprecated=1 shim=bluetooth::stopAdvertising
2017-09-19 23:54:46 +02:00
function stopAdvertising ( ) : void ;
2016-06-14 15:30:07 +02:00
}
// Auto-generated. Do not edit. Really.