Commit 898c9a67 authored by martin hou's avatar martin hou

feat: 补充方法描述

parent 792ac420
...@@ -99,12 +99,13 @@ export type Logger = { ...@@ -99,12 +99,13 @@ export type Logger = {
}; };
declare class Jensen { declare class Jensen {
constructor(log?: Logger); constructor(log?: Logger, conn?: USBDevice);
init: () => Promise<boolean>; init: () => Promise<boolean>;
connect: () => Promise<void>; connect: () => Promise<void>;
onconnect: () => void; onconnect: () => void;
disconnect: () => void; disconnect: () => void;
ondisconnect?: () => void; ondisconnect?: () => void;
reconnect: () => Promise<boolean>;
isStopConnectionCheck: boolean; isStopConnectionCheck: boolean;
isConnected: () => boolean; isConnected: () => boolean;
getModel: () => string; getModel: () => string;
......
...@@ -161,6 +161,7 @@ async function Jensen(log, conn) { ...@@ -161,6 +161,7 @@ async function Jensen(log, conn) {
if (device && device.opened) device.close(); if (device && device.opened) device.close();
device.open(); device.open();
await setup(); await setup();
return true;
} }
catch(ex) catch(ex)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment