feat: Add device info handling and improve UI for telemetry settings

This commit is contained in:
Janez T
2025-10-14 21:20:00 +02:00
parent 9238be1a59
commit 2cb6c34167
2 changed files with 120 additions and 32 deletions

View File

@@ -133,6 +133,29 @@ class ConnectionProvider with ChangeNotifier {
onLoginFail?.call(publicKeyPrefix);
};
_bleService.onDeviceInfoReceived = (deviceInfo) {
print('📥 [Provider] Received DeviceInfo:');
print(' Firmware Version: ${deviceInfo['firmwareVersion']}');
print(' Max Contacts: ${deviceInfo['maxContacts']}');
print(' Max Channels: ${deviceInfo['maxChannels']}');
print(' BLE PIN: ${deviceInfo['blePin']}');
print(' Build Date: ${deviceInfo['firmwareBuildDate']}');
print(' Model: ${deviceInfo['manufacturerModel']}');
print(' Version: ${deviceInfo['semanticVersion']}');
_deviceInfo = _deviceInfo.copyWith(
firmwareVersion: deviceInfo['firmwareVersion'] as int?,
maxContacts: deviceInfo['maxContacts'] as int?,
maxChannels: deviceInfo['maxChannels'] as int?,
blePin: deviceInfo['blePin'] as int?,
firmwareBuildDate: deviceInfo['firmwareBuildDate'] as String?,
manufacturerModel: deviceInfo['manufacturerModel'] as String?,
semanticVersion: deviceInfo['semanticVersion'] as String?,
);
notifyListeners();
print('✅ [Provider] Device info updated with DeviceInfo');
};
_bleService.onSelfInfoReceived = (selfInfo) {
print('📥 [Provider] Received SelfInfo:');
print(' TX Power: ${selfInfo['txPower']} / ${selfInfo['maxTxPower']} dBm');