예제 #1
0
 @Override
 public void removeDevice(String dSID) {
   Device intDevice = strucMan.getDeviceByDSID(dSID);
   if (intDevice != null) {
     strucMan.deleteDevice(intDevice);
     trashDevices.add(new TrashDevice(intDevice));
   }
 }
예제 #2
0
 @Override
 public void unregisterDeviceListener(DeviceStatusListener deviceListener) {
   if (deviceListener != null) {
     String id = deviceListener.getDeviceStatusListenerID();
     if (id.equals(DeviceStatusListener.DEVICE_DISCOVERY)) {
       this.deviceDiscovery = null;
     } else {
       Device intDevice = strucMan.getDeviceByDSID(deviceListener.getDeviceStatusListenerID());
       if (intDevice != null) {
         intDevice.unregisterDeviceStateListener();
       }
     }
   }
 }
예제 #3
0
 @Override
 public void registerDeviceListener(DeviceStatusListener deviceListener) {
   if (deviceListener != null) {
     String id = deviceListener.getDeviceStatusListenerID();
     logger.debug("register DeviceListener with id: " + id);
     if (id.equals(DeviceStatusListener.DEVICE_DISCOVERY)) {
       this.deviceDiscovery = deviceListener;
       for (Device device : strucMan.getDeviceMap().values()) {
         deviceDiscovery.onDeviceAdded(device);
       }
     } else {
       Device intDevice = strucMan.getDeviceByDSID(deviceListener.getDeviceStatusListenerID());
       if (intDevice != null) {
         intDevice.registerDeviceStateListener(deviceListener);
       } else {
         deviceListener.onDeviceRemoved(null);
       }
     }
   }
 }