mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-13 01:10:28 +00:00
feat: Add support for hash and private channels with corresponding UI updates
- Introduced new localization strings for channel types and their descriptions in Italian, German, Spanish, French, Croatian, Slovenian, and English. - Updated the `AppProvider` to handle channel info reception, including deletion of channels and updating the UI accordingly. - Enhanced `ChannelsProvider` to support channel removal and notify listeners. - Modified `ConnectionProvider` to include methods for checking empty channel slots and deleting channels. - Updated BLE service methods to handle channel deletion and verification. - Improved the `AddChannelDialog` to differentiate between hash and private channels, including dynamic UI elements based on channel type. - Added delete functionality for channels in the `ContactTile` widget with confirmation dialogs. - Adjusted permission request dialog behavior to allow dismissing by tapping outside.
This commit is contained in:
@@ -390,16 +390,21 @@ class FrameParser {
|
||||
|
||||
/// Parse ChannelInfo response
|
||||
static Map<String, dynamic> parseChannelInfo(BufferReader reader) {
|
||||
// Format: [channel_idx(1)][name(32)][secret(16)][flags(1)]
|
||||
// Minimum: 1 + 32 + 16 + 1 = 50 bytes
|
||||
if (reader.remainingBytesCount < 50) {
|
||||
// Format: [channel_idx(1)][name(32)][secret(16)][flags(1)?]
|
||||
// Minimum: 1 + 32 + 16 = 49 bytes (flags is optional)
|
||||
if (reader.remainingBytesCount < 49) {
|
||||
return {};
|
||||
}
|
||||
|
||||
final channelIdx = reader.readByte();
|
||||
final channelName = reader.readCString(32);
|
||||
final secret = reader.readBytes(16);
|
||||
final flags = reader.readByte();
|
||||
|
||||
// Flags field is optional (some firmware versions don't include it)
|
||||
int? flags;
|
||||
if (reader.remainingBytesCount >= 1) {
|
||||
flags = reader.readByte();
|
||||
}
|
||||
|
||||
return {
|
||||
'channelIdx': channelIdx,
|
||||
|
||||
Reference in New Issue
Block a user