getCurrentNasDevice static method
获取当前NAS设备信息,首次访问时自动从本地存储加载
Implementation
static Future<NASDeviceInfo> getCurrentNasDevice() async {
await _ensureInitialized();
// 如果本地没有缓存,返回默认设备信息
if (_currentNasDevice == null) {
_currentNasDevice = NASDeviceInfo(
serviceName: 'AI NAS',
serviceType: "NAS",
sn: await APPDeviceUtils.getOrCreateDeviceId(),
target: 'Default Target',
port: 58003,
macAddress: '00:00:00:00:00:00',
ipAddress: defaultAddress,
txtRecords: {},
);
}
return _currentNasDevice!;
}