eco-access-specifications 2.0.9 → 2.0.11

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.
@@ -83,7 +83,7 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
83
83
  };
84
84
  var _checkAndExecute = /*#__PURE__*/function () {
85
85
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
86
- var command, rawResult, result, extracted;
86
+ var command, typeMap, rawResult, result, extracted;
87
87
  return _regeneratorRuntime().wrap(function _callee$(_context) {
88
88
  while (1) switch (_context.prev = _context.next) {
89
89
  case 0:
@@ -94,11 +94,32 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
94
94
  return _context.abrupt("return");
95
95
  case 2:
96
96
  isProcessing = true;
97
- command = commandArray.shift();
98
- _context.prev = 4;
99
- _context.next = 7;
97
+ command = commandArray.shift(); // ✅ 类型映射逻辑
98
+ if (command.specWay === 'setPropertiesValue' && command.entity && Array.isArray(command.entity.objects)) {
99
+ typeMap = {
100
+ bool: 0,
101
+ uint8: 1,
102
+ int8: 2,
103
+ uint16: 3,
104
+ int16: 4,
105
+ uint32: 5,
106
+ int32: 6,
107
+ uint64: 7,
108
+ int64: 8,
109
+ "float": 9,
110
+ string: 10
111
+ };
112
+ command.entity.objects.forEach(function (obj) {
113
+ if (typeof obj.type === 'string' && typeMap.hasOwnProperty(obj.type)) {
114
+ obj.type = typeMap[obj.type];
115
+ }
116
+ });
117
+ }
118
+ _context.prev = 5;
119
+ addLog("spec\u6307\u4EE4\u4E0B\u53D1\u6210\u529F:".concat((Device.mac, JSON.stringify(command.entity))));
120
+ _context.next = 9;
100
121
  return specMethod[command.specWay](Device.mac, JSON.stringify(command.entity));
101
- case 7:
122
+ case 9:
102
123
  rawResult = _context.sent;
103
124
  result = parseToObject(rawResult);
104
125
  addLog("spec\u6307\u4EE4\u54CD\u5E94\u6210\u529F\u2705:".concat(JSON.stringify(result)));
@@ -116,11 +137,11 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
116
137
  result: result
117
138
  });
118
139
  }
119
- _context.next = 17;
140
+ _context.next = 19;
120
141
  break;
121
- case 13:
122
- _context.prev = 13;
123
- _context.t0 = _context["catch"](4);
142
+ case 15:
143
+ _context.prev = 15;
144
+ _context.t0 = _context["catch"](5);
124
145
  addLog("spec\u274C\u5931\u8D25:".concat(JSON.stringify(_context.t0)));
125
146
  if (typeof command.onResult === 'function') {
126
147
  command.onResult({
@@ -133,14 +154,14 @@ var createCommandQueue = function createCommandQueue(specMethod, DeviceEvent, De
133
154
  error: _context.t0
134
155
  });
135
156
  }
136
- case 17:
157
+ case 19:
137
158
  isProcessing = false;
138
159
  _checkAndExecute();
139
- case 19:
160
+ case 21:
140
161
  case "end":
141
162
  return _context.stop();
142
163
  }
143
- }, _callee, null, [[4, 13]]);
164
+ }, _callee, null, [[5, 15]]);
144
165
  }));
145
166
  return function checkAndExecute() {
146
167
  return _ref.apply(this, arguments);
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";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};
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";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};
@@ -133,4 +133,5 @@ _defineProperty(LogPage, "navigationOptions", function (_ref) {
133
133
  header: null
134
134
  };
135
135
  });
136
- export { LogPage as default };
136
+ export { LogPage as default };
137
+ LogPage.displayName = 'LogPage';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eco-access-specifications",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "生态链公司插件接入规范,帮助生态链公司提高生产效率.",
5
5
  "main": "index.js",
6
6
  "scripts": {