Cordova Plugin for Corelink RTLS Sensor
Installation
cordova plugin add cordova-plugin-corelink-rtls-sensor --save
or via ionic
ionic cordova plugin add cordova-plugin-corelink-rtls-sensor
Relative Dependencies
cordova-support-kotlin
cordova plugin add cordova-support-kotlin --save
or via ionic
ionic cordova plugin add cordova-support-kotlin
Usage
Ble.start
Definition
Ble.start(successCallback: () => void, failedCallback(errCode: number) => void)
Example
Ble.start(() => {
console.log('started');
}, errCode => {
console.error('Failed to start,', errCode);
});
Ble.stop
Definition
Ble.stop(successCallback: () => void, failedCallback(errCode: number) => void)
Example
Ble.stop(() => {
console.log('stopped');
}, errCode => {
console.error('Failed to stop,', errCode);
});
Ble.setPayload
Definition
Ble.setPayload(payload: number[], successCallback: () => void, failedCallback(errCode: number) => void)
Example
Ble.setPayload([0, 0, 0, 0, 0, 0, 0], () => {
console.log('stopped');
}, errCode => {
console.error('Failed to stop,', errCode);
});
Ble.setTxPowerLevel
Definition
Ble.setTxPowerLevel(txPowerLevel: number, successCallback: () => void, failedCallback(errCode: number) => void)
Example
Ble.setTxPowerLevel(0, () => {
console.log('stopped');
}, errCode => {
console.error('Failed to stop,', errCode);
});
TxPowerLevel
- 0: ADVERTISE_TX_POWER_ULTRA_LOW
- 1: ADVERTISE_TX_POWER_LOW
- 2: ADVERTISE_TX_POWER_MEDIUM
- 3: ADVERTISE_TX_POWER_HIGH (default)
Ble.setAdvertiseMode
Definition
Ble.setAdvertiseMode(AdvertiseMode: number, successCallback: () => void, failedCallback(errCode: number) => void)
Example
Ble.setAdvertiseMode(0, () => {
console.log('stopped');
}, errCode => {
console.error('Failed to stop,', errCode);
});
AdvertiseMode
- 0: ADVERTISE_MODE_LOW_POWER
- 1: ADVERTISE_MODE_BALANCED (default)
- 2: ADVERTISE_MODE_LOW_LATENCY