support for magnetometer service. fix for #112
This commit is contained in:
parent
7a2c4f0056
commit
c1a6c1c66a
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
7
libs/microbit-bluetooth/shims.d.ts
vendored
7
libs/microbit-bluetooth/shims.d.ts
vendored
@ -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.
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user