hfs-bluetooth-adapter
Version:
海富思科技对外提供的蓝牙设备LLSyncSDK
70 lines (69 loc) • 2.11 kB
TypeScript
export type blueToothDeviceInfoType = {
deviceId: string;
name: string;
RSSI: number;
advertisData: ArrayBuffer;
advertisServiceUUIDs: Array<string>;
localName: string;
serviceData: Object;
connectable: boolean;
deviceName?: string;
bindDevice: () => Promise<controlPromiseType>;
writeTokenToLock: () => Promise<controlPromiseType>;
disconnectDevice: () => Promise<string>;
authenticateConnection: ({ token }: {
token: string;
}) => Promise<controlPromiseType>;
unbindDevice: () => Promise<controlPromiseType & {
deviceName: string;
}>;
openLock: () => Promise<controlPromiseType>;
closeLock: () => Promise<controlPromiseType>;
addPwd: () => Promise<controlPromiseType & {
pwdId: number;
}>;
deletePwd: () => Promise<controlPromiseType>;
addFP: () => void;
deleteFP?: () => Promise<controlPromiseType>;
addRfCard: () => void;
deleteRfCard?: () => Promise<controlPromiseType>;
lockReset: () => Promise<controlPromiseType>;
getAllPwd: () => Promise<controlPromiseType>;
getHistory: () => Promise<controlPromiseType>;
getBattery: () => Promise<controlPromiseType>;
on: () => void;
controlDevice: () => Promise<controlPromiseType>;
controlAction: () => Promise<controlPromiseType>;
};
export type searchDeviceOptionsType = {
onSearch: (devices: (WechatMiniprogram.BlueToothDevice & {
productId: string;
})[]) => void;
onError: (error: WechatMiniprogram.BluetoothError | {
errMsg: string;
}) => void;
};
export type controlPropertyType = {
deviceData: any;
};
export type controlActionType = {
actionData: {
actionId: string;
params: any;
};
};
export type controlPromiseType = {
msg: string;
result: number | {
pwdId: number;
name: string;
pwdtype: string;
start_effective_time?: number;
end_effective_time?: number;
open_lock_time?: number;
}[];
} | {
errMsg: string;
result: number;
error?: WechatMiniprogram.BluetoothError;
};