diff --git a/lib/providers/app_provider.dart b/lib/providers/app_provider.dart index dd52e9a..ee54017 100644 --- a/lib/providers/app_provider.dart +++ b/lib/providers/app_provider.dart @@ -186,8 +186,8 @@ class AppProvider with ChangeNotifier { final contact = contactsProvider .findContactByKey(message.senderPublicKeyPrefix!); if (contact != null) { - final updatedMessage = message.copyWith(senderName: contact.advName); - // Note: You might want to update the message in the list + // Note: Message sender name could be updated here if needed + // final updatedMessage = message.copyWith(senderName: contact.advName); } } }; diff --git a/lib/screens/device_config_screen.dart b/lib/screens/device_config_screen.dart index 5434cbe..1d1e758 100644 --- a/lib/screens/device_config_screen.dart +++ b/lib/screens/device_config_screen.dart @@ -21,7 +21,6 @@ class _DeviceConfigScreenState extends State { late TextEditingController _txPowerController; bool _telemetryEnabled = false; - bool _isBroadcasting = false; String _selectedBandwidth = '62.5 kHz'; int _selectedSpreadingFactor = 8; int _selectedCodingRate = 8; @@ -380,62 +379,6 @@ class _DeviceConfigScreenState extends State { } } - Future _broadcastNow() async { - final connectionProvider = context.read(); - - if (!connectionProvider.deviceInfo.isConnected) { - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(AppLocalizations.of(context)!.deviceNotConnected), - backgroundColor: Colors.orange, - ), - ); - } - return; - } - - setState(() => _isBroadcasting = true); - - try { - // Send self advertisement to mesh network - await connectionProvider.sendSelfAdvert(floodMode: true); - - if (context.mounted) { - final deviceInfo = connectionProvider.deviceInfo; - final lat = deviceInfo.advLat != null - ? (deviceInfo.advLat! / 1000000).toStringAsFixed(6) - : '0.0'; - final lon = deviceInfo.advLon != null - ? (deviceInfo.advLon! / 1000000).toStringAsFixed(6) - : '0.0'; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - AppLocalizations.of(context)!.advertisedAtLocation(lat, lon), - ), - backgroundColor: Colors.green, - ), - ); - } - } catch (e) { - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - AppLocalizations.of(context)!.failedToAdvertise(e.toString()), - ), - backgroundColor: Colors.red, - ), - ); - } - } finally { - if (mounted) { - setState(() => _isBroadcasting = false); - } - } - } - @override Widget build(BuildContext context) { final deviceInfo = context.watch().deviceInfo; diff --git a/lib/services/meshcore_ble_service.dart b/lib/services/meshcore_ble_service.dart index 381355b..4cac04b 100644 --- a/lib/services/meshcore_ble_service.dart +++ b/lib/services/meshcore_ble_service.dart @@ -281,11 +281,10 @@ class MeshCoreBleService { // STEP 2: Send app start to initialize the app session // This is the first command after connection per protocol documentation debugPrint('🚀 [Service] Sending app start (CMD_APP_START)...'); - final selfInfo = await _commandSender - .writeDataAndWaitForResponse>( - FrameBuilder.buildAppStart(), - MeshCoreConstants.respSelfInfo, - ); + await _commandSender.writeDataAndWaitForResponse>( + FrameBuilder.buildAppStart(), + MeshCoreConstants.respSelfInfo, + ); debugPrint('✅ [Service] Self info received: node initialized'); // STEP 3: Set device clock AFTER initialization diff --git a/lib/services/protocol/frame_parser.dart b/lib/services/protocol/frame_parser.dart index b3d4484..21b45ae 100644 --- a/lib/services/protocol/frame_parser.dart +++ b/lib/services/protocol/frame_parser.dart @@ -229,9 +229,9 @@ class FrameParser { final advLon = ByteData.sublistView(Uint8List.fromList(advLonBytes)) .getInt32(0, Endian.little); - final multiAcks = reader.readByte(); - final advertLocPolicy = reader.readByte(); - final telemetryModes = reader.readByte(); + reader.readByte(); // multiAcks (reserved for future use) + reader.readByte(); // advertLocPolicy (reserved for future use) + reader.readByte(); // telemetryModes (reserved for future use) final manualAddContacts = reader.readByte(); final radioFreqBytes = reader.readBytes(4); diff --git a/test_driver/integration_test.dart b/test_driver/integration_test.dart deleted file mode 100644 index b38629c..0000000 --- a/test_driver/integration_test.dart +++ /dev/null @@ -1,3 +0,0 @@ -import 'package:integration_test/integration_test_driver.dart'; - -Future main() => integrationDriver();