initialize static method

FutureOr initialize(
  1. String appid,
  2. String secret, {
  3. DynamicLibrary? nativeLib,
})

Implementation

static FutureOr initialize(String appid, String secret,{DynamicLibrary? nativeLib}) async {
  int code = await ClingVerify.verify(appid, secret);
  code = 1;
  if (code != 1) {
    _sdkInitSuccess = false;
    return ClingBleError(
        code: code,
        message: 'sdk init failed, please check appid and secret');
  }
  _sdkInitSuccess = true;
  await WinBle.initialize(serverPath: await WinServer.path());

  WinBle.bleState.listen((event) {
    slog(event.toString());
  });
  WinBle.connectionStream.listen((event) {
    slog(event.toString());
  });
  ClingBleEvent.onMessageSend = (cmd) {
    // clingNative.cwsCLCmdDisconnect();
    // clingNative.cwsCLCmdConnect();
    if (isConnect) {
      _CLCmdFileHandleInternal._prepare(cmd);
      _currentConnect?.send(cmd);
    } else {
      slog('error, device not connected');
    }
  };
}