Skip to content

Commit d465f26

Browse files
authored
Remove mdns feature (#3979)
It seems is not available under PWA, so better remove it.
1 parent 4823832 commit d465f26

File tree

7 files changed

+4
-269
lines changed

7 files changed

+4
-269
lines changed

locales/en/messages.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@
120120
"message": "Show all serial devices (for manufacturers or development)",
121121
"description": "Do not filter serial devices using VID/PID values (for manufacturers or development)"
122122
},
123-
"useMdnsBrowser": {
124-
"message": "Use mDNS Browser Device discovery on network (experimental)",
125-
"description": "Enable mDNS Browser Device discovery in PortHandler (experimental)"
126-
},
127123
"showManualMode": {
128124
"message": "Enable manual connection mode",
129125
"description": "Text for the option to enable or disable manual connection mode"

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"@fortawesome/fontawesome-free": "^6.5.1",
3030
"@panter/vue-i18next": "^0.15.2",
3131
"@vitejs/plugin-vue2": "^2.2.0",
32-
"bonjour": "^3.5.0",
3332
"crypto-es": "^2.1.0",
3433
"d3": "^7.8.2",
3534
"djv": "^2.1.4",

src/js/mdns_discovery.js

Lines changed: 0 additions & 140 deletions
This file was deleted.

src/js/port_handler.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import GUI from "./gui";
22
import FC from "./fc";
33
import { i18n } from "./localization";
44
import { get as getConfig } from "./ConfigStorage";
5-
import MdnsDiscovery from "./mdns_discovery";
65
import { isWeb } from "./utils/isWeb";
76
import { usbDevices } from "./usb_devices";
87
import { serialShim } from "./serial_shim.js";
@@ -29,7 +28,6 @@ const PortHandler = new function () {
2928
this.dfu_available = false;
3029
this.port_available = false;
3130
this.showAllSerialDevices = false;
32-
this.useMdnsBrowser = false;
3331
this.showVirtualMode = getConfig('showVirtualMode').showVirtualMode;
3432
this.showManualMode = getConfig('showManualMode').showManualMode;
3533
};
@@ -64,11 +62,6 @@ PortHandler.reinitialize = function () {
6462
}
6563

6664
this.showAllSerialDevices = getConfig('showAllSerialDevices').showAllSerialDevices;
67-
this.useMdnsBrowser = getConfig('useMdnsBrowser').useMdnsBrowser;
68-
69-
if (this.useMdnsBrowser) {
70-
MdnsDiscovery.initialize();
71-
}
7265

7366
this.check(); // start listening, check after TIMEOUT_CHECK ms
7467
};
@@ -90,23 +83,8 @@ PortHandler.check_serial_devices = function () {
9083
const self = this;
9184

9285
const updatePorts = function(cp) {
93-
self.currentPorts = [];
94-
95-
if (self.useMdnsBrowser) {
96-
self.currentPorts = [
97-
...cp,
98-
...(MdnsDiscovery.mdnsBrowser.services?.filter(s => s.txt?.vendor === 'elrs' && s.txt?.type === 'rx' && s.ready === true)
99-
.map(s => s.addresses.map(a => ({
100-
path: `tcp://${a}`,
101-
displayName: `${s.txt?.target} - ${s.txt?.version}`,
102-
fqdn: s.fqdn,
103-
vendorId: 0,
104-
productId: 0,
105-
}))).flat() ?? []),
106-
].filter(Boolean);
107-
} else {
108-
self.currentPorts = cp;
109-
}
86+
87+
self.currentPorts = cp;
11088

11189
// auto-select port (only during initialization)
11290
if (!self.initialPorts) {

src/js/tabs/options.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ options.initialize = function (callback) {
2323
TABS.options.initAnalyticsOptOut();
2424
TABS.options.initCliAutoComplete();
2525
TABS.options.initShowAllSerialDevices();
26-
TABS.options.initUseMdnsBrowser();
2726
TABS.options.initShowVirtualMode();
2827
TABS.options.initUseManualConnection();
2928
TABS.options.initCordovaForceComputerUI();
@@ -159,17 +158,6 @@ options.initUseManualConnection = function() {
159158
});
160159
};
161160

162-
options.initUseMdnsBrowser = function() {
163-
const useMdnsBrowserElement = $('div.useMdnsBrowser input');
164-
const result = getConfig('useMdnsBrowser');
165-
useMdnsBrowserElement
166-
.prop('checked', !!result.useMdnsBrowser)
167-
.on('change', () => {
168-
setConfig({ useMdnsBrowser: useMdnsBrowserElement.is(':checked') });
169-
PortHandler.reinitialize();
170-
});
171-
};
172-
173161
options.initCordovaForceComputerUI = function () {
174162
if (GUI.isCordova() && cordovaUI.canChangeUI) {
175163
const result = getConfig('cordovaForceComputerUI');

src/tabs/options.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@
3535
</div>
3636
<span class="freelabel" i18n="showAllSerialDevices"></span>
3737
</div>
38-
<div class="useMdnsBrowser margin-bottom">
39-
<div>
40-
<input type="checkbox" class="toggle" />
41-
</div>
42-
<span class="freelabel" i18n="useMdnsBrowser"></span>
43-
</div>
4438
<div class="showManualMode margin-bottom">
4539
<div>
4640
<input type="checkbox" class="toggle" />

0 commit comments

Comments
 (0)