Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit c206c09

Browse files
committed
feat: Add low-bandwidth mode
1 parent a9f1e0b commit c206c09

12 files changed

+1801
-1296
lines changed

lib/matrix_api_lite.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/* MIT License
2-
*
2+
*
33
* Copyright (C) 2019, 2020, 2021 Famedly GmbH
4-
*
4+
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to deal
77
* in the Software without restriction, including without limitation the rights
88
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
* copies of the Software, and to permit persons to whom the Software is
1010
* furnished to do so, subject to the following conditions:
11-
*
11+
*
1212
* The above copyright notice and this permission notice shall be included in all
1313
* copies or substantial portions of the Software.
14-
*
14+
*
1515
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -50,6 +50,7 @@ export 'src/model/events/room_key_request_content.dart';
5050
export 'src/model/events/secret_storage_default_key_content.dart';
5151
export 'src/model/events/secret_storage_key_content.dart';
5252
export 'src/model/events/tombstone_content.dart';
53+
export 'src/utils/low_bandwidth_helper.dart';
5354
export 'src/model/matrix_connection_exception.dart';
5455
export 'src/model/matrix_event.dart';
5556
export 'src/model/matrix_exception.dart';

lib/src/config/coap_config.dart

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// GENERATED CODE, do not edit this file.
2+
3+
import 'package:coap/coap.dart';
4+
5+
/// Configuration loading class. The config file itself is a YAML
6+
/// file. The configuration items below are marked as optional to allow
7+
/// the config file to contain only those entries that override the defaults.
8+
/// The file can't be empty, so version must as a minimum be present.
9+
class CoapConfig extends DefaultCoapConfig {
10+
CoapConfig() {
11+
DefaultCoapConfig.inst = this;
12+
}
13+
14+
@override
15+
CoapISpec? spec;
16+
17+
@override
18+
String get version => 'RFC7252';
19+
20+
@override
21+
String get deduplicator => 'MarkAndSweep';
22+
23+
@override
24+
int get ackTimeout => 30000;
25+
26+
@override
27+
bool get poolUdpConnectionsByClient => true;
28+
29+
@override
30+
bool get dtlsUse => true;
31+
32+
@override
33+
String get dtlsCiphers => 'aRSA';
34+
35+
@override
36+
String get logTarget => 'console';
37+
38+
@override
39+
bool get logError => true;
40+
41+
@override
42+
bool get logDebug => false;
43+
44+
@override
45+
bool get logWarn => true;
46+
47+
@override
48+
bool get logInfo => false;
49+
}

lib/src/config/coap_config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Protocol section
2+
version: "RFC7252"
3+
deduplicator: "MarkAndSweep" # CropRotayion or Noop
4+
ackTimeout: 30000 # ms
5+
6+
poolUdpConnectionsByClient: true
7+
8+
dtls:
9+
use: true
10+
ciphers: aRSA
11+
12+
# Logging section
13+
14+
# Target is none or console
15+
logTarget: "console"
16+
# Log levels
17+
logError: true
18+
logDebug: false
19+
logWarn: true
20+
logInfo: false

0 commit comments

Comments
 (0)