2022-10-04 13:12:54 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2022 Yubico.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-03-04 15:42:10 +03:00
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
|
|
|
|
import '../app/models.dart';
|
2022-03-09 19:47:50 +03:00
|
|
|
import '../core/state.dart';
|
2023-11-27 13:41:05 +03:00
|
|
|
import 'models.dart';
|
2022-03-04 15:42:10 +03:00
|
|
|
|
2023-05-03 22:20:08 +03:00
|
|
|
final managementStateProvider = AsyncNotifierProvider.autoDispose
|
|
|
|
.family<ManagementStateNotifier, DeviceInfo, DevicePath>(
|
|
|
|
() => throw UnimplementedError(),
|
2022-03-04 15:42:10 +03:00
|
|
|
);
|
|
|
|
|
2022-03-09 19:47:50 +03:00
|
|
|
abstract class ManagementStateNotifier
|
|
|
|
extends ApplicationStateNotifier<DeviceInfo> {
|
2022-03-04 15:42:10 +03:00
|
|
|
Future<void> writeConfig(DeviceConfig config,
|
|
|
|
{String currentLockCode = '',
|
|
|
|
String newLockCode = '',
|
|
|
|
bool reboot = false});
|
|
|
|
|
2022-05-05 13:40:56 +03:00
|
|
|
Future<void> setMode({
|
|
|
|
required int interfaces,
|
|
|
|
int challengeResponseTimeout = 0,
|
|
|
|
int? autoEjectTimeout,
|
|
|
|
});
|
2024-02-02 15:52:22 +03:00
|
|
|
|
|
|
|
Future<void> deviceReset();
|
2022-03-04 15:42:10 +03:00
|
|
|
}
|