updated signatures
This commit is contained in:
parent
c5c5362b5d
commit
f0947cddaa
@ -1,5 +1,4 @@
|
|||||||
#include "pxt.h"
|
#include "pxt.h"
|
||||||
#include "Microbit.h"
|
|
||||||
#include "MicroBitEddystone.h"
|
#include "MicroBitEddystone.h"
|
||||||
|
|
||||||
using namespace pxt;
|
using namespace pxt;
|
||||||
@ -13,12 +12,14 @@ namespace eddystone {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Advertise an Eddystone URL
|
* Advertise an Eddystone URL
|
||||||
|
* @param url the url to transmit. Must be no longer than the supported eddystone url length
|
||||||
|
* @param power power level between 0 and 7, e.g.: 7
|
||||||
|
* @param connectable true to keep bluetooth connectable for other services, false otherwise
|
||||||
*/
|
*/
|
||||||
//% blockId=eddystone_advertise_url block="eddystone advertise url %url|power %powerLevel"
|
//% blockId=eddystone_advertise_url block="eddystone advertise url %url|power %powerLevel"
|
||||||
void advertiseUrl(StringData* url, int powerLevel) {
|
void advertiseUrl(StringData* url, int power, bool connectable) {
|
||||||
int power = CALIBRATED_POWERS[min(7, max(0, powerLevel))];
|
int8_t level = CALIBRATED_POWERS[min(7, max(0, power))];
|
||||||
ManagedString murl(url)
|
uBit.bleManager.advertiseEddystoneUrl(ManagedString(url), level, connectable);
|
||||||
uBit.bleManager.advertiseEddystoneUrl(murl, power, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
//% color=#0082FB weight=19
|
//% color=#0082FB weight=19
|
||||||
namespace eddystone {
|
namespace eddystone {
|
||||||
//% shim=eddystone::advertiseUrl
|
//% shim=eddystone::advertiseUrl
|
||||||
export function advertiseUrl(url: string, powerLevel: number) {
|
export function advertiseUrl(url: string, powerLevel: number, connectable: boolean) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//% shim=eddystone::stopAdvertising
|
//% shim=eddystone::stopAdvertising
|
||||||
|
5
libs/eddystone/shims.d.ts
vendored
5
libs/eddystone/shims.d.ts
vendored
@ -9,9 +9,12 @@ declare namespace eddystone {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Advertise an Eddystone URL
|
* Advertise an Eddystone URL
|
||||||
|
* @param url the url to transmit. Must be no longer than the supported eddystone url length
|
||||||
|
* @param power power level between 0 and 7, e.g.: 7
|
||||||
|
* @param connectable true to keep bluetooth connectable for other services, false otherwise
|
||||||
*/
|
*/
|
||||||
//% blockId=eddystone_advertise_url block="eddystone advertise url %url|power %powerLevel" shim=eddystone::advertiseUrl
|
//% blockId=eddystone_advertise_url block="eddystone advertise url %url|power %powerLevel" shim=eddystone::advertiseUrl
|
||||||
function advertiseUrl(url: string, powerLevel: number): void;
|
function advertiseUrl(url: string, power: number, connectable: boolean): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops advertising Eddystone end points
|
* Stops advertising Eddystone end points
|
||||||
|
Loading…
Reference in New Issue
Block a user