support for magnetometer service. fix for #112

This commit is contained in:
Peli de Halleux 2016-06-14 13:39:24 -07:00
parent 7a2c4f0056
commit c1a6c1c66a
3 changed files with 19 additions and 0 deletions

View File

@ -30,4 +30,13 @@ namespace bluetooth {
void startTemperatureService() { void startTemperatureService() {
new MicroBitTemperatureService(*uBit.ble, uBit.thermometer); new MicroBitTemperatureService(*uBit.ble, uBit.thermometer);
} }
/**
* Starts the magnetometer service
*/
//% help=bluetooth/start-magnetometer-service
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service"
void startMagnetometerService() {
new MicroBitMagnetometerService(*uBit.ble, uBit.compass);
}
} }

View File

@ -25,6 +25,13 @@ declare namespace bluetooth {
//% help=bluetooth/start-temperature-service //% help=bluetooth/start-temperature-service
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" shim=bluetooth::startTemperatureService //% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" shim=bluetooth::startTemperatureService
function startTemperatureService(): void; function startTemperatureService(): void;
/**
* Starts the magnetometer service
*/
//% help=bluetooth/start-magnetometer-service
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service" shim=bluetooth::startMagnetometerService
function startMagnetometerService(): void;
} }
// Auto-generated. Do not edit. Really. // Auto-generated. Do not edit. Really.

View File

@ -624,6 +624,9 @@ namespace pxsim.bluetooth {
export function startTemperatureService(): void { export function startTemperatureService(): void {
// TODO // TODO
} }
export function startMagnetometerService(): void {
// TODO
}
} }
namespace pxsim.images { namespace pxsim.images {