Skip to content

Commit 7afc7da

Browse files
authored
Use random number for PAN ID when creating new network (#1421)
Signed-off-by: Chris Jackson <[email protected]>
1 parent ce5a364 commit 7afc7da

File tree

1 file changed

+2
-1
lines changed
  • com.zsmartsystems.zigbee.console.main/src/main/java/com/zsmartsystems/zigbee/console/main

1 file changed

+2
-1
lines changed

com.zsmartsystems.zigbee.console.main/src/main/java/com/zsmartsystems/zigbee/console/main/ZigBeeConsoleMain.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.util.List;
1313
import java.util.Set;
1414
import java.util.TreeSet;
15+
import java.util.concurrent.ThreadLocalRandom;
1516
import java.util.stream.Collectors;
1617
import java.util.stream.Stream;
1718

@@ -352,7 +353,7 @@ public static void main(final String[] args) {
352353
if (cmdline.hasOption("pan")) {
353354
pan = parseDecimalOrHexInt(cmdline.getOptionValue("pan"));
354355
} else {
355-
pan = 1;
356+
pan = ThreadLocalRandom.current().nextInt(1, 0x10000);
356357
}
357358
if (cmdline.hasOption("epan")) {
358359
extendedPan = new ExtendedPanId(cmdline.getOptionValue("epan"));

0 commit comments

Comments
 (0)