connect static method
Future<Onvif>
connect(
{ - required String host,
- required String username,
- required String password,
- LogOptions logOptions = const LogOptions(LogLevel.error, stackTraceLevel: LogLevel.off),
- LoggyPrinter printer = const PrettyPrinter(showColors: false),
- Dio? dio,
- bool overrideSpecificationAuthentication = false,
})
Implementation
static Future<Onvif> connect({
/// The host name or IP address of the Onvif device
required String host,
/// The username to use for authentication
required String username,
/// The password to use for authentication
required String 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;
}