-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Beegan
committed
Apr 11, 2024
1 parent
7fb1fc1
commit 6ea2d22
Showing
5 changed files
with
58 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:reverse_beacon/reverse_beacon.dart'; | ||
import 'package:reverse_beacon/src/band.dart'; | ||
import 'package:reverse_beacon/src/cw_spot.dart'; | ||
import 'package:reverse_beacon/src/exceptions.dart'; | ||
import 'package:reverse_beacon/src/mode.dart'; | ||
|
||
void main() async{ | ||
void main() async { | ||
var rb = ReverseBeacon(); | ||
try{ | ||
try { | ||
await rb.connect(callsign: 'n1bri'); | ||
} | ||
on TelnetCommunicationException catch(_){ | ||
} on TelnetCommunicationException catch (_) { | ||
print('Telnet Communication Exception'); | ||
exit(-1); | ||
} | ||
on InvalidCallsignException catch(_){ | ||
} on InvalidCallsignException catch (_) { | ||
print('Invalid callsign'); | ||
exit(-1); | ||
} | ||
catch(ex){ | ||
} catch (ex) { | ||
print('unknown issue'); | ||
exit(-1); | ||
} | ||
rb.controller.stream.listen((spot) { | ||
int spotCount = 0; | ||
rb.listen((spot) { | ||
//filter | ||
if(spot.band == Band.meters20 && spot.mode == Mode.cw){ | ||
if ((spot as CWSpot).wpm == 15){ | ||
if (spot.band == Band.meters20 && spot.mode == Mode.cw) { | ||
if ((spot as CWSpot).wpm >= 15) { | ||
print(spot); | ||
spotCount++; | ||
} | ||
} | ||
if (spotCount == 5) { | ||
rb.close(); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/// Support for doing something awesome. | ||
/// | ||
/// More dartdocs go here. | ||
|
||
library; | ||
|
||
export 'src/reverse_beacon_base.dart'; | ||
|
||
// TODO: Export any libraries intended for clients of this package. | ||
export 'src/cw_spot.dart'; | ||
export 'package:reverse_beacon/reverse_beacon.dart'; | ||
export 'package:reverse_beacon/src/band.dart'; | ||
export 'package:reverse_beacon/src/exceptions.dart'; | ||
export 'package:reverse_beacon/src/mode.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters