Onvif constructor

Onvif({
  1. required AuthInfo authInfo,
  2. required LogOptions logOptions,
  3. required LoggyPrinter printer,
  4. Dio? dio,
  5. bool overrideSpecificationAuthentication = false,
})

Implementation

Onvif({
  required this.authInfo,
  required LogOptions logOptions,
  required LoggyPrinter printer,
  Dio? dio,
  this.overrideSpecificationAuthentication = false,
})  : _dio = dio ??
          Dio(
            BaseOptions(
              connectTimeout: Duration(seconds: 20),
              receiveTimeout: Duration(seconds: 10),
            ),
          )
        ..interceptors.add(LoggingInterceptors()),
      _hostUri = (authInfo.host.startsWith('http')
              ? authInfo.host
              : 'http://${authInfo.host}')
          .parseUri {
  Loggy.initLoggy(logPrinter: printer, logOptions: logOptions);

  _transport = soap.Transport(
    dio: _dio,
    authInfo: authInfo,
    overrideSpecificationAuthentication: overrideSpecificationAuthentication,
  );

  _deviceManagement = DeviceManagement(
      transport: transport,
      uri: '${_hostUri.origin}/onvif/device_service'.parseUri);
}