Search in sources :

Example 1 with ZigBeeEndpointDao

use of com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeNode method setDao.

public void setDao(ZigBeeNodeDao dao) {
    ieeeAddress = new IeeeAddress(dao.getIeeeAddress());
    networkAddress = dao.getNetworkAddress();
    nodeDescriptor = dao.getNodeDescriptor();
    powerDescriptor = dao.getPowerDescriptor();
    if (dao.getBindingTable() != null) {
        bindingTable.addAll(dao.getBindingTable());
    }
    for (ZigBeeEndpointDao endpointDao : dao.getEndpoints()) {
        ZigBeeEndpoint endpoint = new ZigBeeEndpoint(networkManager, this, endpointDao.getEndpointId());
        endpoint.setDao(endpointDao);
        endpoints.put(endpoint.getEndpointId(), endpoint);
    }
}
Also used : ZigBeeEndpointDao(com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao)

Example 2 with ZigBeeEndpointDao

use of com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeNode method getDao.

/**
 * Gets a {@link ZigBeeNodeDao} representing the node
 *
 * @return the {@link ZigBeeNodeDao}
 */
public ZigBeeNodeDao getDao() {
    ZigBeeNodeDao dao = new ZigBeeNodeDao();
    dao.setIeeeAddress(ieeeAddress.toString());
    dao.setNetworkAddress(networkAddress);
    dao.setNodeDescriptor(nodeDescriptor);
    dao.setPowerDescriptor(powerDescriptor);
    dao.setBindingTable(bindingTable);
    List<ZigBeeEndpointDao> endpointDaoList = new ArrayList<ZigBeeEndpointDao>();
    for (ZigBeeEndpoint endpoint : endpoints.values()) {
        endpointDaoList.add(endpoint.getDao());
    }
    dao.setEndpoints(endpointDaoList);
    return dao;
}
Also used : ZigBeeNodeDao(com.zsmartsystems.zigbee.dao.ZigBeeNodeDao) ArrayList(java.util.ArrayList) ZigBeeEndpointDao(com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao)

Example 3 with ZigBeeEndpointDao

use of com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeEndpoint method getDao.

/**
 * Gets a {@link ZigBeeEndpointDao} used for serialisation of the {@link ZigBeeEndpoint}
 *
 * @return the {@link ZigBeeEndpointDao}
 */
public ZigBeeEndpointDao getDao() {
    ZigBeeEndpointDao dao = new ZigBeeEndpointDao();
    dao.setEndpointId(endpointId);
    dao.setProfileId(profileId);
    List<ZclClusterDao> clusters;
    clusters = new ArrayList<ZclClusterDao>();
    for (ZclCluster cluster : inputClusters.values()) {
        clusters.add(cluster.getDao());
    }
    dao.setInputClusters(clusters);
    clusters = new ArrayList<ZclClusterDao>();
    for (ZclCluster cluster : outputClusters.values()) {
        clusters.add(cluster.getDao());
    }
    dao.setOutputClusters(clusters);
    return dao;
}
Also used : ZclClusterDao(com.zsmartsystems.zigbee.dao.ZclClusterDao) ZigBeeEndpointDao(com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao) ZclCluster(com.zsmartsystems.zigbee.zcl.ZclCluster)

Example 4 with ZigBeeEndpointDao

use of com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeEndpointTest method setDao.

@Test
public void setDao() {
    ZigBeeEndpoint endpoint = getEndpoint();
    ZigBeeEndpointDao dao = new ZigBeeEndpointDao();
    endpoint.setDao(dao);
}
Also used : ZigBeeEndpointDao(com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao) Test(org.junit.Test)

Aggregations

ZigBeeEndpointDao (com.zsmartsystems.zigbee.dao.ZigBeeEndpointDao)4 ZclClusterDao (com.zsmartsystems.zigbee.dao.ZclClusterDao)1 ZigBeeNodeDao (com.zsmartsystems.zigbee.dao.ZigBeeNodeDao)1 ZclCluster (com.zsmartsystems.zigbee.zcl.ZclCluster)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1