connect static method

Future<Onvif> connect({
  1. required dynamic host,
  2. required dynamic username,
  3. required dynamic password,
  4. LogOptions logOptions = const LogOptions(LogLevel.error, stackTraceLevel: LogLevel.off),
  5. LoggyPrinter printer = const PrettyPrinter(showColors: false),
  6. Dio? dio,
  7. bool overrideSpecificationAuthentication = false,
})

Implementation

static Future<Onvif> connect({
  /// The host name or IP address of the Onvif device
  required host,

  /// The username to use for authentication
  required username,

  /// The password to use for authentication
  required password,

  /// The log options to use for logging
  LogOptions logOptions = const LogOptions(
    LogLevel.error,
    stackTraceLevel: LogLevel.off,
  ),

  /// The printer to use for logging formatting
  LoggyPrinter printer = const PrettyPrinter(
    showColors: false,
  ),

  /// The dio instance to use for making http requests
  Dio? dio,

  /// Whether to override the authentication specified in the Onvif specification
  bool overrideSpecificationAuthentication = false,
}) async {
  final onvif = Onvif(
    authInfo: AuthInfo(
      host: host,
      username: username,
      password: password,
    ),
    logOptions: logOptions,
    printer: printer,
    dio: dio,
    overrideSpecificationAuthentication: overrideSpecificationAuthentication,
  );

  await onvif.initialize();

  return onvif;
}