@psdk/device-ble-taro 0.2.33 → 0.2.35

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/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ConnectedDevice, ConnectionState, ReadOptions } from "@psdk/frame";
1
+ import { ConnectedDevice, ConnectionState, ReadOptions } from "@psdk/frame-father";
2
2
  import Taro from "@tarojs/taro";
3
3
  export declare class TaroBleConnectedDevice implements ConnectedDevice {
4
4
  private readonly device;
@@ -18,5 +18,6 @@ export declare class TaroBleConnectedDevice implements ConnectedDevice {
18
18
  disconnect(): Promise<void>;
19
19
  read(options?: ReadOptions): Promise<Uint8Array>;
20
20
  write(data: Uint8Array): Promise<void>;
21
+ flush(): void;
21
22
  }
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,eAAe,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAC1E,OAAO,IAAI,MAAM,cAAc,CAAC;AAGhC,qBAAa,sBAAuB,YAAW,eAAe;IAC5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgE;IACvF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;IAC/D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqD;IAEpF,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,UAAU,CAA4D;gBAE3D,OAAO,EAAE;QAC1B,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,oCAAoC,CAAC;QACtE,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC;QAC9C,cAAc,EAAE,IAAI,CAAC,2BAA2B,CAAC,iBAAiB,CAAC;KACpE;IAQD,OAAO,CAAC,QAAQ;YASF,QAAQ;IAYtB,eAAe,IAAI,eAAe;IAIlC,UAAU,IAAI,MAAM;IAId,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAG3B,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAsBhD,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAiB7C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,eAAe,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACjF,OAAO,IAAI,MAAM,cAAc,CAAC;AAGhC,qBAAa,sBAAuB,YAAW,eAAe;IAC5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgE;IACvF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;IAC/D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqD;IAEpF,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,UAAU,CAA4D;gBAE3D,OAAO,EAAE;QAC1B,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,oCAAoC,CAAC;QACtE,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC;QAC9C,cAAc,EAAE,IAAI,CAAC,2BAA2B,CAAC,iBAAiB,CAAC;KACpE;IAQD,OAAO,CAAC,QAAQ;YASF,QAAQ;IAYtB,eAAe,IAAI,eAAe;IAIlC,UAAU,IAAI,MAAM;IAId,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAG3B,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAsBhD,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB5C,KAAK,IAAI,IAAI;CAKd"}
package/build/index.js CHANGED
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.TaroBleConnectedDevice = void 0;
16
- const frame_1 = require("@psdk/frame");
16
+ const frame_father_1 = require("@psdk/frame-father");
17
17
  const taro_1 = __importDefault(require("@tarojs/taro"));
18
18
  const await_timeout_1 = __importDefault(require("await-timeout"));
19
19
  class TaroBleConnectedDevice {
@@ -21,7 +21,7 @@ class TaroBleConnectedDevice {
21
21
  this.device = options.device;
22
22
  this.service = options.service;
23
23
  this.characteristic = options.characteristic;
24
- this._connectionState = frame_1.ConnectionState.CONNECTED;
24
+ this._connectionState = frame_father_1.ConnectionState.CONNECTED;
25
25
  this.doListen();
26
26
  }
27
27
  doListen() {
@@ -29,7 +29,7 @@ class TaroBleConnectedDevice {
29
29
  this.dataOfRead.push(value);
30
30
  });
31
31
  taro_1.default.onBLEConnectionStateChange(value => {
32
- this._connectionState = value.connected ? frame_1.ConnectionState.CONNECTED : frame_1.ConnectionState.DISCONNECTED;
32
+ this._connectionState = value.connected ? frame_father_1.ConnectionState.CONNECTED : frame_father_1.ConnectionState.DISCONNECTED;
33
33
  });
34
34
  }
35
35
  realRead() {
@@ -96,5 +96,8 @@ class TaroBleConnectedDevice {
96
96
  });
97
97
  });
98
98
  }
99
+ flush() {
100
+ this.dataOfRead.splice(0, this.dataOfRead.length);
101
+ }
99
102
  }
100
103
  exports.TaroBleConnectedDevice = TaroBleConnectedDevice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psdk/device-ble-taro",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "psdk",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -46,12 +46,12 @@
46
46
  "webpack-cli": "^4.9.2"
47
47
  },
48
48
  "dependencies": {
49
- "@psdk/frame": "0.2.33",
49
+ "@psdk/frame-father": "0.2.35",
50
50
  "await-timeout": "^1.1.1"
51
51
  },
52
52
  "files": [
53
53
  "build",
54
54
  "!build/browser/psdk*"
55
55
  ],
56
- "gitHead": "fbb7e5e83b26e6ffd59e84a13d9fd464cbe09670"
56
+ "gitHead": "c7f0050eee6537a4f14095d07761f5206cba8d38"
57
57
  }