incyclist-devices 3.0.14 → 3.0.15

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.
@@ -98,10 +98,10 @@ class BleInterface extends node_events_1.EventEmitter {
98
98
  await this.connectInternal();
99
99
  }
100
100
  async connect(reconnect) {
101
- if (this.isAutoStart)
101
+ if (this.isAutoStart && !reconnect)
102
102
  return this.isConnected();
103
103
  else
104
- return this.connectInternal(reconnect);
104
+ return await this.connectInternal(reconnect);
105
105
  }
106
106
  async connectInternal(reconnect) {
107
107
  if (this.isConnected())
@@ -95,10 +95,10 @@ export class BleInterface extends EventEmitter {
95
95
  await this.connectInternal();
96
96
  }
97
97
  async connect(reconnect) {
98
- if (this.isAutoStart)
98
+ if (this.isAutoStart && !reconnect)
99
99
  return this.isConnected();
100
100
  else
101
- return this.connectInternal(reconnect);
101
+ return await this.connectInternal(reconnect);
102
102
  }
103
103
  async connectInternal(reconnect) {
104
104
  if (this.isConnected())
@@ -10,7 +10,7 @@ export type InterfaceProps = {
10
10
  export interface IncyclistInterface extends EventEmitter {
11
11
  getName(): string;
12
12
  setBinding(binding: any): void;
13
- connect(): Promise<boolean>;
13
+ connect(reconnect?: boolean): Promise<boolean>;
14
14
  disconnect(): Promise<boolean>;
15
15
  terminate(): Promise<void>;
16
16
  isConnected(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-devices",
3
- "version": "3.0.14",
3
+ "version": "3.0.15",
4
4
  "scripts": {
5
5
  "lint": "eslint . --ext .ts",
6
6
  "build": "npm run build:esm && npm run build:cjs",