Skip to content

Commit

Permalink
release: 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JagandeepBrar committed May 6, 2023
1 parent 71f2204 commit fbe5901
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 3.2.0

- feat: allow repeatedly sending the packet in a single socket connection (Thanks to @AlexV525)
- feat: support constructing an `IPv4Address` instance from a host URL (Thanks to @AlexV525)

# 3.1.1+1

- chore: update metadata
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ if(IPv4Address.validate(address)) {
}
```

You can also optionally create an `IPv4Address` instance using the `fromHost(host, { typePredicate })` static method which will lookup the host and use the associated IPv4 address. By default this will choose the first associated IPv4 address found in the lookup but you can further control which IPv4 address is chosen by defining the `typePredicate` parameter.

#### Create MAC Address

`MACAddress` is a helper class to ensure that your MAC address has been formatted correctly.
Expand Down Expand Up @@ -68,7 +70,7 @@ if(MACAddress.validate(address, delimiter: delimiter)) {

Create a `WakeOnLAN` instance by using `WakeOnLAN(ipv4, mac, { port })` where `ipv4` is an `IPv4Address` instance, `mac` is a `MACAddress` instance, and `port` is an optional integer parameter for which port the packet should be sent over (defaulted to the specification standard port, 9).

Once created, call the function `wake()` on the `WakeOnLAN` object to send the packet.
Once created, call the function `wake({ repeat })` on the `WakeOnLAN` object to send the packet. You may optionally set the `repeat` integer parameter to repeatedly send the Wake on LAN packet (with a 100ms delay between repeats) before closing the socket connection.

```dart
String mac = 'AA:BB:CC:DD:EE:FF';
Expand Down
4 changes: 3 additions & 1 deletion lib/src/wake_on_lan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class WakeOnLAN {
/// The socket will then be used to send the constructed packet to the address in [IPv4Address] and [port].
///
/// Increase the [repeat] times in case you want to ensure the packet can be sent successfully.
Future<void> wake({int repeat = 1}) async {
Future<void> wake({
int repeat = 1,
}) async {
return RawDatagramSocket.bind(InternetAddress.anyIPv4, 0).then(
(socket) async {
final addr = ipv4Address.address;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wake_on_lan
description: Send wake on LAN magic packets to devices on your local network.
version: 3.1.1+1
version: 3.2.0
homepage: https://github.com/JagandeepBrar/package-wake-on-lan
repository: https://github.com/JagandeepBrar/package-wake-on-lan
issue_tracker: https://github.com/JagandeepBrar/package-wake-on-lan/issues
Expand Down

0 comments on commit fbe5901

Please sign in to comment.