Removed generics from device listener and updated some js libs
This commit is contained in:
parent
53d471c0aa
commit
94bfbbd664
18 changed files with 707 additions and 689 deletions
|
|
@ -2,9 +2,7 @@ package se.hal.plugin.tellstick;
|
|||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import se.hal.intf.HalDeviceReportListener;
|
||||
import se.hal.intf.HalEventConfig;
|
||||
import se.hal.intf.HalEventData;
|
||||
import se.hal.intf.*;
|
||||
import se.hal.plugin.tellstick.test.TestEventDevice;
|
||||
import se.hal.plugin.tellstick.test.TestProtocol;
|
||||
|
||||
|
|
@ -47,10 +45,10 @@ public class TellstickSerialCommEventTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalEventConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalDeviceReportListener<HalEventConfig,HalEventData>() {
|
||||
tellstick.addListener(new HalDeviceReportListener() {
|
||||
@Override
|
||||
public void reportReceived(HalEventConfig e, HalEventData d) {
|
||||
list.add(e);
|
||||
public void reportReceived(HalDeviceConfig e, HalDeviceData d) {
|
||||
list.add((HalEventConfig) e);
|
||||
}
|
||||
});
|
||||
// Execution
|
||||
|
|
@ -65,10 +63,10 @@ public class TellstickSerialCommEventTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalEventConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalDeviceReportListener<HalEventConfig,HalEventData>() {
|
||||
tellstick.addListener(new HalDeviceReportListener() {
|
||||
@Override
|
||||
public void reportReceived(HalEventConfig e, HalEventData d) {
|
||||
list.add(e);
|
||||
public void reportReceived(HalDeviceConfig e, HalDeviceData d) {
|
||||
list.add((HalEventConfig) e);
|
||||
}
|
||||
});
|
||||
// Execution
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@ package se.hal.plugin.tellstick;
|
|||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import se.hal.intf.HalDeviceReportListener;
|
||||
import se.hal.intf.HalSensorConfig;
|
||||
import se.hal.intf.HalSensorData;
|
||||
import se.hal.intf.*;
|
||||
import se.hal.plugin.tellstick.test.TestProtocol;
|
||||
import se.hal.plugin.tellstick.test.TestSensorDevice;
|
||||
|
||||
|
|
@ -32,10 +30,10 @@ public class TellstickSerialCommSensorTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalSensorConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalDeviceReportListener<HalSensorConfig,HalSensorData>() {
|
||||
tellstick.addListener(new HalDeviceReportListener() {
|
||||
@Override
|
||||
public void reportReceived(HalSensorConfig e, HalSensorData d) {
|
||||
list.add(e);
|
||||
public void reportReceived(HalDeviceConfig e, HalDeviceData d) {
|
||||
list.add((HalSensorConfig) e);
|
||||
}
|
||||
});
|
||||
// Execution
|
||||
|
|
@ -50,10 +48,10 @@ public class TellstickSerialCommSensorTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalSensorConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalDeviceReportListener<HalSensorConfig,HalSensorData>() {
|
||||
tellstick.addListener(new HalDeviceReportListener() {
|
||||
@Override
|
||||
public void reportReceived(HalSensorConfig e, HalSensorData d) {
|
||||
list.add(e);
|
||||
public void reportReceived(HalDeviceConfig e, HalDeviceData d) {
|
||||
list.add((HalSensorConfig) e);
|
||||
}
|
||||
});
|
||||
// Execution
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import java.util.logging.Level;
|
|||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* Controller that will connect to a Zigbee USB coordinator.
|
||||
*/
|
||||
public class HalZigbeeController implements HalSensorController,
|
||||
HalEventController,
|
||||
|
|
@ -254,7 +254,7 @@ public class HalZigbeeController implements HalSensorController,
|
|||
if (config != null) {
|
||||
registerCluster(endpoint, config);
|
||||
} else {
|
||||
logger.finest("[Node: " + endpoint.getIeeeAddress() + "] Cluster ID '" + inputClusterId + "' is not supported.");
|
||||
logger.finest("[Node: " + endpoint.getIeeeAddress() + ", Endpoint: " + endpoint.getEndpointId() + "] Cluster ID '" + inputClusterId + "' is not supported.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@ public class ZigBeeDataStore implements ZigBeeNetworkDataStore {
|
|||
|
||||
@Override
|
||||
public void writeNode(ZigBeeNodeDao node) {
|
||||
logger.fine("[Node: " + node.getIeeeAddress() + "] Storing Zigbee Node in DB: " +
|
||||
"IeeAddr: " + node.getIeeeAddress() + ", " +
|
||||
logger.fine("[Node: " + node.getIeeeAddress() + "]: Storing Zigbee Node in DB: " +
|
||||
"NetAddr: " + node.getNetworkAddress() + ", " +
|
||||
"binding: " + node.getBindingTable() + ", " +
|
||||
"description: " + node.getNodeDescriptor() + ", " +
|
||||
|
|
@ -66,7 +65,7 @@ public class ZigBeeDataStore implements ZigBeeNetworkDataStore {
|
|||
|
||||
@Override
|
||||
public void removeNode(IeeeAddress address) {
|
||||
logger.fine("[Node: " + address + "] Removing Node from DB.");
|
||||
logger.fine("[Node: " + address + "]: Removing Node from DB.");
|
||||
|
||||
devices.remove(address);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ import com.zsmartsystems.zigbee.ZigBeeNetworkManager;
|
|||
import com.zsmartsystems.zigbee.ZigBeeNode;
|
||||
import com.zsmartsystems.zigbee.zcl.ZclAttribute;
|
||||
import com.zsmartsystems.zigbee.zcl.ZclCluster;
|
||||
import se.hal.intf.HalDeviceConfig;
|
||||
import se.hal.intf.HalDeviceData;
|
||||
import se.hal.intf.HalDeviceReportListener;
|
||||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
|
|
@ -46,6 +49,12 @@ public class HalZigbeeControllerTest {
|
|||
|
||||
HalZigbeeController controller = new HalZigbeeController();
|
||||
controller.initialize("COM5", HalZigbeeController.ZIGBEE_DONGLE_CC2531);
|
||||
controller.addListener(new HalDeviceReportListener() {
|
||||
@Override
|
||||
public void reportReceived(HalDeviceConfig deviceConfig, HalDeviceData deviceData) {
|
||||
System.out.println("Device reported: " + deviceConfig + " , " + deviceData);
|
||||
}
|
||||
});
|
||||
|
||||
Scanner in = new Scanner(System.in);
|
||||
handleConsoleInput("h", in, controller.networkManager);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue