eco-access-specifications 2.0.12 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/CommandQueue.js +35 -25
- package/lib/ble/index.js +233 -0
- package/lib/global.js +18 -1
- package/lib/index.js +2 -1
- package/lib/index.min.js +1 -1
- package/package.json +1 -1
package/lib/base/CommandQueue.js
CHANGED
|
@@ -72,7 +72,7 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
|
|
|
72
72
|
if (typeof o.siid === 'number' && typeof o.piid === 'number') {
|
|
73
73
|
result["".concat(o.siid, "_").concat(o.piid)] = o.value;
|
|
74
74
|
} else if (typeof o.type === 'number' && typeof o.piid === 'number') {
|
|
75
|
-
result["".concat(o.
|
|
75
|
+
result["".concat(o.piid)] = o.value;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
} catch (err) {
|
|
@@ -85,7 +85,7 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
|
|
|
85
85
|
};
|
|
86
86
|
var _checkAndExecute = /*#__PURE__*/function () {
|
|
87
87
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
88
|
-
var command, rawResult, result, _result$objects$, extracted;
|
|
88
|
+
var command, timeoutId, timeoutPromise, rawResult, result, _result$objects$, extracted;
|
|
89
89
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
90
90
|
while (1) switch (_context.prev = _context.next) {
|
|
91
91
|
case 0:
|
|
@@ -121,53 +121,62 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
|
|
|
121
121
|
// }
|
|
122
122
|
// });
|
|
123
123
|
// }
|
|
124
|
-
|
|
124
|
+
timeoutPromise = new Promise(function (_, reject) {
|
|
125
|
+
timeoutId = setTimeout(function () {
|
|
126
|
+
reject(new Error('spec指令响应超时'));
|
|
127
|
+
}, 5000);
|
|
128
|
+
});
|
|
129
|
+
_context.prev = 5;
|
|
125
130
|
addLog("spec\u6307\u4EE4\u4E0B\u53D1\u6210\u529F:".concat((Device.mac, JSON.stringify(command.entity))));
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
|
|
132
|
+
// 用 Promise.race 来实现超时
|
|
133
|
+
_context.next = 9;
|
|
134
|
+
return Promise.race([specMethod[command.specWay](Device.mac, JSON.stringify(command.entity)), timeoutPromise]);
|
|
135
|
+
case 9:
|
|
129
136
|
rawResult = _context.sent;
|
|
137
|
+
clearTimeout(timeoutId); // 🟢 清除超时定时器
|
|
130
138
|
result = parseToObject(rawResult);
|
|
131
139
|
addLog("spec\u6307\u4EE4\u54CD\u5E94\u6210\u529F\u2705:".concat(JSON.stringify(result)));
|
|
132
140
|
if (!(typeof command.onResult === 'function')) {
|
|
133
|
-
_context.next =
|
|
141
|
+
_context.next = 17;
|
|
134
142
|
break;
|
|
135
143
|
}
|
|
136
144
|
command.onResult({
|
|
137
145
|
type: command.specWay,
|
|
138
146
|
result: result
|
|
139
147
|
});
|
|
140
|
-
_context.next =
|
|
148
|
+
_context.next = 26;
|
|
141
149
|
break;
|
|
142
|
-
case
|
|
150
|
+
case 17:
|
|
143
151
|
if (!(typeof command.onResultVal === 'function')) {
|
|
144
|
-
_context.next =
|
|
152
|
+
_context.next = 25;
|
|
145
153
|
break;
|
|
146
154
|
}
|
|
147
155
|
extracted = extractValues(result, command.targets);
|
|
148
|
-
if (!((result === null || result === void 0 || (_result$objects$ = result.objects[0]) === null || _result$objects$ === void 0 ? void 0 : _result$objects$.code) !== 0)) {
|
|
149
|
-
_context.next =
|
|
156
|
+
if (!((result === null || result === void 0 || (_result$objects$ = result.objects[0]) === null || _result$objects$ === void 0 ? void 0 : _result$objects$.code) !== 0 && command.specWay !== 'doAction')) {
|
|
157
|
+
_context.next = 22;
|
|
150
158
|
break;
|
|
151
159
|
}
|
|
152
160
|
addLog("spec\u6307\u4EE4\u54CD\u5E94\u5931\u8D25\u274C:".concat(JSON.stringify(extracted)));
|
|
153
161
|
throw new Error("spec\u6307\u4EE4\u54CD\u5E94\u5931\u8D25\u274C:".concat(JSON.stringify(extracted)));
|
|
154
|
-
case
|
|
162
|
+
case 22:
|
|
155
163
|
command.onResultVal(extracted);
|
|
156
|
-
_context.next =
|
|
164
|
+
_context.next = 26;
|
|
157
165
|
break;
|
|
158
|
-
case
|
|
166
|
+
case 25:
|
|
159
167
|
if (globalCallback) {
|
|
160
168
|
globalCallback({
|
|
161
169
|
type: command.specWay,
|
|
162
170
|
result: result
|
|
163
171
|
});
|
|
164
172
|
}
|
|
165
|
-
case 24:
|
|
166
|
-
_context.next = 30;
|
|
167
|
-
break;
|
|
168
173
|
case 26:
|
|
169
|
-
_context.
|
|
170
|
-
|
|
174
|
+
_context.next = 33;
|
|
175
|
+
break;
|
|
176
|
+
case 28:
|
|
177
|
+
_context.prev = 28;
|
|
178
|
+
_context.t0 = _context["catch"](5);
|
|
179
|
+
clearTimeout(timeoutId); // 🔴 出现异常也要清除
|
|
171
180
|
addLog("spec\u274C\u5931\u8D25:".concat(JSON.stringify(_context.t0)));
|
|
172
181
|
if (typeof command.error === 'function') {
|
|
173
182
|
command.error({
|
|
@@ -185,14 +194,14 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
|
|
|
185
194
|
error: _context.t0
|
|
186
195
|
});
|
|
187
196
|
}
|
|
188
|
-
case
|
|
197
|
+
case 33:
|
|
189
198
|
isProcessing = false;
|
|
190
199
|
_checkAndExecute();
|
|
191
|
-
case
|
|
200
|
+
case 35:
|
|
192
201
|
case "end":
|
|
193
202
|
return _context.stop();
|
|
194
203
|
}
|
|
195
|
-
}, _callee, null, [[
|
|
204
|
+
}, _callee, null, [[5, 28]]);
|
|
196
205
|
}));
|
|
197
206
|
return function checkAndExecute() {
|
|
198
207
|
return _ref.apply(this, arguments);
|
|
@@ -227,7 +236,8 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
|
|
|
227
236
|
var callback = args[args.length - 1];
|
|
228
237
|
|
|
229
238
|
// 清除旧订阅
|
|
230
|
-
Device.getBluetoothLE().unsubscribeMessages();
|
|
239
|
+
// Device.getBluetoothLE().unsubscribeMessages();
|
|
240
|
+
|
|
231
241
|
(_console = console).log.apply(_console, ['订阅属性:'].concat(_toConsumableArray(props)));
|
|
232
242
|
(_Device$getBluetoothL = Device.getBluetoothLE()).subscribeMessages.apply(_Device$getBluetoothL, _toConsumableArray(props)).then(function (subscription) {
|
|
233
243
|
addLog("\u2705 \u8BA2\u9605\u6210\u529F\uFF1A".concat(JSON.stringify(subscription)));
|
|
@@ -243,7 +253,7 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
|
|
|
243
253
|
return function () {
|
|
244
254
|
// 调用返回的函数可用于取消监听
|
|
245
255
|
listener.remove();
|
|
246
|
-
Device.getBluetoothLE().unsubscribeMessages();
|
|
256
|
+
// Device.getBluetoothLE().unsubscribeMessages();
|
|
247
257
|
};
|
|
248
258
|
};
|
|
249
259
|
return {
|
package/lib/ble/index.js
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { getDevice, getHost, getBluetoothEvent, getBluetooth } from "../global.js";
|
|
8
|
+
import { addLog } from "../main/log.js";
|
|
9
|
+
import { AppState, DeviceEventEmitter, Platform } from 'react-native';
|
|
10
|
+
var ble_connect_timeout_1 = 8000;
|
|
11
|
+
var ble_connect_timeout_2 = 15000;
|
|
12
|
+
var bleTrackData = {
|
|
13
|
+
handle_result: '',
|
|
14
|
+
duration: '',
|
|
15
|
+
fail_reason: '',
|
|
16
|
+
startTime: ''
|
|
17
|
+
};
|
|
18
|
+
var timeoutNumber = 0;
|
|
19
|
+
var isFirstTime = true; // 标志变量,记录是否是第一次进入应用
|
|
20
|
+
var startTime_bt_connect, disconnectedTime;
|
|
21
|
+
var bleOnSuccess;
|
|
22
|
+
var bleOnFailure;
|
|
23
|
+
var sysBle = true;
|
|
24
|
+
var timeoutHandle = function timeoutHandle() {
|
|
25
|
+
addLog("\u91CD\u8FDE\u6B21\u6570\uFF1A".concat(timeoutNumber));
|
|
26
|
+
var time = 15000;
|
|
27
|
+
switch (timeoutNumber) {
|
|
28
|
+
case 0:
|
|
29
|
+
time = ble_connect_timeout_1;
|
|
30
|
+
break;
|
|
31
|
+
case 1:
|
|
32
|
+
time = ble_connect_timeout_2;
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
timeoutNumber = 0;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return time;
|
|
39
|
+
};
|
|
40
|
+
var _pollingConnected = function pollingConnected() {
|
|
41
|
+
// 重连逻辑
|
|
42
|
+
var Device = getDevice();
|
|
43
|
+
var bt = Device.getBluetoothLE();
|
|
44
|
+
bt.disconnect();
|
|
45
|
+
if (sysBle === false) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (Platform.OS == 'android') {
|
|
49
|
+
disconnectedTime && clearTimeout(disconnectedTime);
|
|
50
|
+
disconnectedTime = setTimeout(function () {
|
|
51
|
+
bt.isConnected ? _pollingConnected() : bleConnect();
|
|
52
|
+
}, 600);
|
|
53
|
+
} else {
|
|
54
|
+
bleConnect();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var timeLogEnd = function timeLogEnd(startTime, str) {
|
|
58
|
+
var timeEnd = new Date().getTime();
|
|
59
|
+
addLog(">>>\u65F6\u957F\u76D1\u63A7>>>".concat(str, "\u65F6\u95F4\u5DEE\uFF1A").concat(timeEnd - startTime, ", \u603B\u8017\u65F6\uFF1A").concat(timeEnd - global.initTime, ",\u5F53\u524D\u65F6\u95F4\u6233\uFF1A").concat(timeEnd));
|
|
60
|
+
return startTime;
|
|
61
|
+
};
|
|
62
|
+
var bleConnect = function bleConnect() {
|
|
63
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 4;
|
|
64
|
+
var option = arguments.length > 1 ? arguments[1] : undefined;
|
|
65
|
+
var onSuccess = arguments.length > 2 ? arguments[2] : undefined;
|
|
66
|
+
var onFailure = arguments.length > 3 ? arguments[3] : undefined;
|
|
67
|
+
var Device = getDevice();
|
|
68
|
+
var bt = Device.getBluetoothLE();
|
|
69
|
+
bt.disconnect();
|
|
70
|
+
addLog("\u8FDE\u63A5\u72B6\u6001:".concat(bt.isConnected));
|
|
71
|
+
if (bt.isConnected) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (!(bleOnSuccess || bleOnFailure)) {
|
|
75
|
+
bleOnSuccess = onSuccess;
|
|
76
|
+
bleOnFailure = onFailure;
|
|
77
|
+
}
|
|
78
|
+
if (!(bleOnFailure || bleOnSuccess)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
startTime_bt_connect = new Date().getTime();
|
|
82
|
+
var timeout = timeoutHandle();
|
|
83
|
+
timeLogEnd(startTime_bt_connect, 'bt.connect开始');
|
|
84
|
+
addLog('Start connect:', {
|
|
85
|
+
name: 'connect',
|
|
86
|
+
time: Date.now(),
|
|
87
|
+
logState: 'before'
|
|
88
|
+
});
|
|
89
|
+
checkBluetoothIsEnabled(true);
|
|
90
|
+
bt.connect(type, _objectSpread({
|
|
91
|
+
did: Device.deviceID,
|
|
92
|
+
timeout: timeout
|
|
93
|
+
}, option)).then(function (data) {
|
|
94
|
+
timeLogEnd(startTime_bt_connect, 'bt.connect连接成功');
|
|
95
|
+
addLog('End connect:', {
|
|
96
|
+
name: 'connect',
|
|
97
|
+
time: Date.now(),
|
|
98
|
+
logState: 'after'
|
|
99
|
+
});
|
|
100
|
+
bleOnSuccess && bleOnSuccess(data);
|
|
101
|
+
})["catch"](function (data) {
|
|
102
|
+
timeLogEnd(startTime_bt_connect, 'bt.connect连接失败');
|
|
103
|
+
bleTrackData.duration = new Date().getTime() - startTime_bt_connect;
|
|
104
|
+
bleTrackData.fail_reason = JSON.stringify(data);
|
|
105
|
+
addLog("ble connect failed: ".concat(JSON.stringify(data)));
|
|
106
|
+
timeoutNumber++;
|
|
107
|
+
|
|
108
|
+
// Handle different error codes
|
|
109
|
+
var handleError = function handleError() {
|
|
110
|
+
if (!sysBle) {
|
|
111
|
+
bt.disconnect();
|
|
112
|
+
bleOnFailure && bleOnFailure('系统蓝牙未开启');
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
if (timeoutNumber > 1 || [-6, -16].includes(data.code)) {
|
|
116
|
+
bt.disconnect();
|
|
117
|
+
bleOnFailure && bleOnFailure(data);
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
// if ([-2, -27, -53, 999, -28, -7].includes(data.code)) {
|
|
121
|
+
_pollingConnected();
|
|
122
|
+
// }
|
|
123
|
+
// if (data.code == -16) {
|
|
124
|
+
// bt.disconnect();
|
|
125
|
+
// // setTimeout(() => {
|
|
126
|
+
// // this.onShowToast("请重新绑定设备后重试");
|
|
127
|
+
// // }, 500);
|
|
128
|
+
// }
|
|
129
|
+
};
|
|
130
|
+
handleError();
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// 抽象 AppState 监听,并内嵌后台断开、前台重连逻辑
|
|
135
|
+
var setupAppStateListener = function setupAppStateListener() {
|
|
136
|
+
var handleConnection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
137
|
+
var disconnectFn = arguments.length > 1 ? arguments[1] : undefined;
|
|
138
|
+
var connectFn = arguments.length > 2 ? arguments[2] : undefined;
|
|
139
|
+
return AppState.addEventListener('change', function (state) {
|
|
140
|
+
if (isFirstTime) {
|
|
141
|
+
// 第一次进入时不执行逻辑,只更新标志变量
|
|
142
|
+
isFirstTime = false;
|
|
143
|
+
addLog('AppState first initialization, ignoring...');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
addLog("AppState change: ".concat(state));
|
|
147
|
+
if (state === 'background' && handleConnection) {
|
|
148
|
+
// 在切换到后台时断开连接
|
|
149
|
+
addLog('App is in background, disconnecting...');
|
|
150
|
+
disconnectFn && disconnectFn();
|
|
151
|
+
} else if (state === 'active' && handleConnection) {
|
|
152
|
+
// 在回到前台时重新连接
|
|
153
|
+
addLog('App is active, reconnecting...');
|
|
154
|
+
_pollingConnected();
|
|
155
|
+
connectFn && connectFn();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
var checkBluetoothIsEnabled = function checkBluetoothIsEnabled(checkClosed) {
|
|
160
|
+
var Bluetooth = getBluetooth();
|
|
161
|
+
Bluetooth.checkBluetoothIsEnabled().then(function (result) {
|
|
162
|
+
var Host = getHost();
|
|
163
|
+
addLog(">>>>>>>>>>>>>>>>>> \u68C0\u67E5\u84DD\u7259\u6253\u5F00\u60C5\u51B5 IsEnabled: ".concat(result));
|
|
164
|
+
if (result) {
|
|
165
|
+
sysBle = true;
|
|
166
|
+
Host.ui.dismissBLESwitchGuide();
|
|
167
|
+
addLog("iOS \u5173\u95ED\u7C73\u5BB6\u6253\u5F00\u84DD\u7259\u5F39\u7A97");
|
|
168
|
+
addLog('蓝牙已开启');
|
|
169
|
+
if (!checkClosed) {
|
|
170
|
+
_pollingConnected();
|
|
171
|
+
}
|
|
172
|
+
} else {
|
|
173
|
+
sysBle = false;
|
|
174
|
+
addLog('蓝牙未开启,请检查开启蓝牙后再试');
|
|
175
|
+
if (Host.isAndroid) {
|
|
176
|
+
Bluetooth.enableBluetoothForAndroid(true);
|
|
177
|
+
addLog("Android \u5F39\u51FA\u63D0\u793A\u6253\u5F00\u84DD\u7259\u5F39\u7A97");
|
|
178
|
+
} else {
|
|
179
|
+
Host.ui.showBLESwitchGuide();
|
|
180
|
+
addLog("iOS \u5F39\u51FA\u63D0\u793A\u6253\u5F00\u84DD\u7259\u5F39\u7A97");
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
// 抽象蓝牙状态监听
|
|
186
|
+
var setupBluetoothStatusListener = function setupBluetoothStatusListener(onBluetoothOn) {
|
|
187
|
+
var Device = getDevice();
|
|
188
|
+
var BluetoothEvent = getBluetoothEvent();
|
|
189
|
+
var bt = Device.getBluetoothLE();
|
|
190
|
+
return BluetoothEvent.bluetoothStatusChanged.addListener(function (isOn) {
|
|
191
|
+
var Host = getHost();
|
|
192
|
+
sysBle = isOn;
|
|
193
|
+
addLog("\u84DD\u7259\u72B6\u6001\u53D1\u751F\u53D8\u5316 \uFF1A ".concat(JSON.stringify(isOn)));
|
|
194
|
+
checkBluetoothIsEnabled();
|
|
195
|
+
if (!isOn) {
|
|
196
|
+
bt.disconnect();
|
|
197
|
+
addLog('蓝牙连接已断开');
|
|
198
|
+
onBluetoothOn && onBluetoothOn(isOn); // 蓝牙关闭时的逻辑
|
|
199
|
+
} else {
|
|
200
|
+
addLog('蓝牙已开启');
|
|
201
|
+
Host.ui.dismissBLESwitchGuide();
|
|
202
|
+
onBluetoothOn && onBluetoothOn(isOn); // 蓝牙开启时的逻辑
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* 蓝牙连接状态监听
|
|
209
|
+
* @return {Promise<unknown>}
|
|
210
|
+
*/
|
|
211
|
+
var bluetoothConnectionStatusChanged = function bluetoothConnectionStatusChanged(onBluetoothOn) {
|
|
212
|
+
var BluetoothEvent = getBluetoothEvent();
|
|
213
|
+
return BluetoothEvent.bluetoothConnectionStatusChanged.addListener(function (blut, isConnect) {
|
|
214
|
+
onBluetoothOn && onBluetoothOn(isConnect);
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
var disconnect = function disconnect(waitToSendDatas) {
|
|
218
|
+
var Host = getHost();
|
|
219
|
+
var Device = getDevice();
|
|
220
|
+
var bt = Device.getBluetoothLE();
|
|
221
|
+
if (!bt.isConnected && !bt.isConnecting) {
|
|
222
|
+
// 为了防止频繁断联占用指令资源
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
waitToSendDatas = []; // 若有蓝牙任务需要清除任务队列,若没有可以不写
|
|
226
|
+
if (Host.isAndroid) {
|
|
227
|
+
bt.disconnect(0, true);
|
|
228
|
+
} else {
|
|
229
|
+
bt.disconnect();
|
|
230
|
+
}
|
|
231
|
+
addLog('断开蓝牙连接');
|
|
232
|
+
};
|
|
233
|
+
export { bleConnect, setupAppStateListener, setupBluetoothStatusListener, checkBluetoothIsEnabled, disconnect, bluetoothConnectionStatusChanged };
|
package/lib/global.js
CHANGED
|
@@ -1,20 +1,37 @@
|
|
|
1
1
|
import { bleSpec } from './main/specMethod';
|
|
2
2
|
var appName = '';
|
|
3
3
|
var Device = {};
|
|
4
|
+
var Host = {};
|
|
4
5
|
var DeviceEvent = {};
|
|
5
6
|
var Service = {};
|
|
6
7
|
var addLog = function addLog() {};
|
|
7
8
|
var Bluetooth = {};
|
|
9
|
+
var BluetoothEvent = {};
|
|
8
10
|
var localLog = function localLog() {};
|
|
9
11
|
var bleSpecQueue = function bleSpecQueue() {};
|
|
10
12
|
var initSpecifications = function initSpecifications(data) {
|
|
11
13
|
appName = data.name;
|
|
12
14
|
Device = data.Device;
|
|
15
|
+
Host = data.Host;
|
|
13
16
|
DeviceEvent = data.DeviceEvent;
|
|
14
17
|
localLog = data.localLog;
|
|
15
18
|
Service = data.Service;
|
|
16
19
|
addLog = data.addLog;
|
|
17
20
|
Bluetooth = data.Bluetooth;
|
|
21
|
+
BluetoothEvent = data.BluetoothEvent;
|
|
18
22
|
bleSpecQueue = bleSpec(Bluetooth, DeviceEvent, Device); // 初始化蓝牙队列
|
|
19
23
|
};
|
|
20
|
-
|
|
24
|
+
// Getter functions
|
|
25
|
+
var getDevice = function getDevice() {
|
|
26
|
+
return Device;
|
|
27
|
+
};
|
|
28
|
+
var getHost = function getHost() {
|
|
29
|
+
return Host;
|
|
30
|
+
};
|
|
31
|
+
var getBluetooth = function getBluetooth() {
|
|
32
|
+
return Bluetooth;
|
|
33
|
+
};
|
|
34
|
+
var getBluetoothEvent = function getBluetoothEvent() {
|
|
35
|
+
return BluetoothEvent;
|
|
36
|
+
};
|
|
37
|
+
export { appName, Device, getHost, Service, initSpecifications, addLog, Bluetooth, getBluetoothEvent, getBluetooth, bleSpecQueue, localLog, DeviceEvent, getDevice };
|
package/lib/index.js
CHANGED
|
@@ -2,4 +2,5 @@ import { initSpecifications, bleSpecQueue } from "./global";
|
|
|
2
2
|
import EcoService from "./main/EcoService.js";
|
|
3
3
|
import { addLog, LogPage } from "./main/log";
|
|
4
4
|
import { oneTrackReport, allTrackPoints } from './eco-track-report';
|
|
5
|
-
|
|
5
|
+
import { bleConnect, setupAppStateListener, setupBluetoothStatusListener, checkBluetoothIsEnabled, disconnect, bluetoothConnectionStatusChanged } from './ble';
|
|
6
|
+
export { LogPage, addLog, bleSpecQueue, initSpecifications, EcoService, oneTrackReport, allTrackPoints, bleConnect, setupAppStateListener, setupBluetoothStatusListener, checkBluetoothIsEnabled, disconnect, bluetoothConnectionStatusChanged };
|
package/lib/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bleSpec}from"./main/specMethod";var appName="",Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";appName="",Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";appName=appName="",Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";export{appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints};
|
|
1
|
+
import{bleSpec}from"./main/specMethod";var appName="",Device={},Host={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},BluetoothEvent={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,Host=e.Host,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,Bluetooth=e.Bluetooth,BluetoothEvent=e.BluetoothEvent,bleSpecQueue=bleSpec(Bluetooth,DeviceEvent,Device)},getDevice=function(){return Device},getHost=function(){return Host},getBluetooth=function(){return Bluetooth},getBluetoothEvent=function(){return BluetoothEvent};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged}from"./ble";import{bleSpec}from"./main/specMethod";appName="",Device={},Host={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},BluetoothEvent={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,Host=e.Host,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,Bluetooth=e.Bluetooth,BluetoothEvent=e.BluetoothEvent,bleSpecQueue=bleSpec(Bluetooth,DeviceEvent,Device)},getDevice=function(){return Device},getHost=function(){return Host},getBluetooth=function(){return Bluetooth},getBluetoothEvent=function(){return BluetoothEvent};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged}from"./ble";import{bleSpec}from"./main/specMethod";Device={},Host={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},BluetoothEvent={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,Host=e.Host,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,Bluetooth=e.Bluetooth,BluetoothEvent=e.BluetoothEvent,bleSpecQueue=bleSpec(Bluetooth,DeviceEvent,Device)},getDevice=function(){return Device},getHost=function(){return Host},getBluetooth=function(){return Bluetooth},getBluetoothEvent=function(){return BluetoothEvent};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged}from"./ble";import{bleSpec}from"./main/specMethod";Device={},Host={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},BluetoothEvent={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,Host=e.Host,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,Bluetooth=e.Bluetooth,BluetoothEvent=e.BluetoothEvent,bleSpecQueue=bleSpec(Bluetooth,DeviceEvent,Device)},getDevice=function(){return Device},getHost=function(){return Host},getBluetooth=function(){return Bluetooth},getBluetoothEvent=function(){return BluetoothEvent};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged}from"./ble";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";import{bleSpec}from"./main/specMethod";appName=appName="",Device={},DeviceEvent={},Service={},addLog=function(){},Bluetooth={},localLog=function(){},bleSpecQueue=function(){},initSpecifications=function(e){appName=e.name,Device=e.Device,DeviceEvent=e.DeviceEvent,localLog=e.localLog,Service=e.Service,addLog=e.addLog,bleSpecQueue=bleSpec(Bluetooth=e.Bluetooth,DeviceEvent,Device)};import{initSpecifications,bleSpecQueue}from"./global";import EcoService from"./main/EcoService.js";import{addLog,LogPage}from"./main/log";import{oneTrackReport,allTrackPoints}from"./eco-track-report";export{appName,Device,getHost,Service,initSpecifications,addLog,Bluetooth,getBluetoothEvent,getBluetooth,bleSpecQueue,localLog,DeviceEvent,getDevice,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged,appName,Device,getHost,Service,initSpecifications,addLog,Bluetooth,getBluetoothEvent,getBluetooth,bleSpecQueue,localLog,DeviceEvent,getDevice,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged,appName,Device,getHost,Service,initSpecifications,addLog,Bluetooth,getBluetoothEvent,getBluetooth,bleSpecQueue,localLog,DeviceEvent,getDevice,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged,appName,Device,getHost,Service,initSpecifications,addLog,Bluetooth,getBluetoothEvent,getBluetooth,bleSpecQueue,localLog,DeviceEvent,getDevice,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,bleConnect,setupAppStateListener,setupBluetoothStatusListener,checkBluetoothIsEnabled,disconnect,bluetoothConnectionStatusChanged,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints,appName,Device,Service,initSpecifications,addLog,Bluetooth,bleSpecQueue,localLog,DeviceEvent,LogPage,addLog,bleSpecQueue,initSpecifications,EcoService,oneTrackReport,allTrackPoints};
|