Small updates
This commit is contained in:
parent
3dbd626aee
commit
e59d65fac0
2 changed files with 15 additions and 8 deletions
|
|
@ -22,7 +22,7 @@ public class HalZigbeeController implements HalSensorController, HalEventControl
|
|||
private static final String CONFIG_ZIGBEE_PANID = "zigbee.pan_id";
|
||||
|
||||
private SerialPort port;
|
||||
private ZigBeeApiDongleImpl zigbeeApi;
|
||||
protected ZigBeeApiDongleImpl zigbeeApi;
|
||||
|
||||
private HalSensorReportListener sensorListener;
|
||||
private HalEventReportListener eventListener;
|
||||
|
|
@ -51,10 +51,6 @@ public class HalZigbeeController implements HalSensorController, HalEventControl
|
|||
false);
|
||||
|
||||
zigbeeApi.startup();
|
||||
|
||||
for (ZigBeeDevice device : zigbeeApi.getDevices()) {
|
||||
System.out.println("Device: " + device.getLabel());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
package se.hal.plugin.zigbee;
|
||||
|
||||
import org.bubblecloud.zigbee.v3.ZigBeeDevice;
|
||||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
|
|
@ -32,13 +33,23 @@ import java.util.logging.Level;
|
|||
|
||||
public class HalZigbeeControllerTest {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
LogUtil.setGlobalFormatter(new CompactLogFormatter());
|
||||
LogUtil.setGlobalLevel(Level.ALL);
|
||||
|
||||
HalZigbeeController controller = new HalZigbeeController();
|
||||
controller.initialize(
|
||||
"COM3");
|
||||
controller.initialize("COM3", -6);
|
||||
|
||||
System.out.println("Enable pairing.");
|
||||
controller.zigbeeApi.permitJoin(true);
|
||||
|
||||
//controller.zigbeeApi
|
||||
|
||||
Thread.sleep(10000);
|
||||
|
||||
for (ZigBeeDevice device : controller.zigbeeApi.getDevices()) {
|
||||
System.out.println("Device: " + device);
|
||||
}
|
||||
|
||||
System.out.println("Press ENTER to exit application.");
|
||||
System.in.read();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue