Skip to content

Commit

Permalink
Small clean
Browse files Browse the repository at this point in the history
  • Loading branch information
hippyau committed Sep 24, 2021
1 parent cc23c2a commit 2d2aed2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/confignodescreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ class _ConfigScreenState extends State<ConfigScreen> {
},
itemBuilder: (_) => [
new CheckedPopupMenuItem(
checked: _srcname == '',
value: '',
checked: _srcname == 'Undefined',
value: 'Undefined',
child: new Text('None'),
),
new CheckedPopupMenuItem(
Expand Down
17 changes: 7 additions & 10 deletions lib/nodes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,23 @@ class NodeRecords {
}

Future<bool> findDevices() async {
searchingForDevices = true;
searchingForDevices = true; // global signal
List<String> foundips = [];

// simulate this device
addDevice("192.168.1.96", name: "E131 Linux", type: "Application");
// addDevice("192.168.1.44", name: "Note", type: "Type");
// addDevice("192.168.1.95", name: "Display Name", type: "Board");
var addedAny = false;

// might be required for android et al.
var addedAny = false; // found anything?

// required for android et al.
var factory = (dynamic host, int port,
{bool? reuseAddress, bool? reusePort, int? ttl}) {
var tll = 5;
return RawDatagramSocket.bind(host, port,
reuseAddress: true, reusePort: true, ttl: tll);
};

final MDnsClient client = MDnsClient(rawDatagramSocketFactory: factory);

// final MDnsClient client = MDnsClient();

List<String> foundips = [];

// Search for devices
print("mDNS: Search...");
const String name = '_http._tcp.local';
Expand Down

0 comments on commit 2d2aed2

Please sign in to comment.