From 23eefb28d2b7c9748c2708014c0a8e09496817bd Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 14 Jun 2016 13:24:55 -0700 Subject: [PATCH] support for starting the temperature service #113 --- libs/microbit-bluetooth/bluetooth.cpp | 9 +++++++++ libs/microbit-bluetooth/shims.d.ts | 7 +++++++ sim/libmbit.ts | 12 ++++++++++++ 3 files changed, 28 insertions(+) diff --git a/libs/microbit-bluetooth/bluetooth.cpp b/libs/microbit-bluetooth/bluetooth.cpp index ef53a82d..594e5727 100644 --- a/libs/microbit-bluetooth/bluetooth.cpp +++ b/libs/microbit-bluetooth/bluetooth.cpp @@ -21,4 +21,13 @@ namespace bluetooth { void startLEDService() { new MicroBitLEDService(*uBit.ble, uBit.display); } + + /** + * Starts the temperature service + */ + //% help=bluetooth/start-temperature-service + //% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" + void startTemperatureService() { + new MicroBitTemperatureService(*uBit.ble, uBit.thermometer); + } } diff --git a/libs/microbit-bluetooth/shims.d.ts b/libs/microbit-bluetooth/shims.d.ts index e6202248..5e04fdea 100644 --- a/libs/microbit-bluetooth/shims.d.ts +++ b/libs/microbit-bluetooth/shims.d.ts @@ -18,6 +18,13 @@ declare namespace bluetooth { //% help=bluetooth/start-led-service //% blockId=bluetooth_start_led_service block="bluetooth led service" shim=bluetooth::startLEDService function startLEDService(): void; + + /** + * Starts the temperature service + */ + //% help=bluetooth/start-led-service + //% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" shim=bluetooth::startTemperatureService + function startTemperatureService(): void; } // Auto-generated. Do not edit. Really. diff --git a/sim/libmbit.ts b/sim/libmbit.ts index 52dc76dc..4a386ceb 100644 --- a/sim/libmbit.ts +++ b/sim/libmbit.ts @@ -614,6 +614,18 @@ namespace pxsim.pins { } +namespace pxsim.bluetooth { + export function startIOPinService(): void { + // TODO + } + export function startLEDService(): void { + // TODO + } + export function startTemperatureService(): void { + // TODO + } +} + namespace pxsim.images { export function createImage(img: Image) { return img } export function createBigImage(img: Image) { return img }