public boolean isSecurityCapable() { if (nodeDescriptor == null) { return false; } return nodeDescriptor.getMacCapabilities().contains(MacCapabilitiesType.SECURITY_CAPABLE); }
/** * Returns true if the node is a Full Function Device. Returns false if not an FFD or logical type is unknown. * <p> * A FFD (Full Function Device) is a device that has full levels of functionality. * It can be used for sending and receiving data, but it can also route data from other nodes. * FFDs are Coordinators and Routers * * @return true if the device is a Full Function Device. Returns false if not an FFD or logical type is unknown. */ public boolean isFullFuntionDevice() { if (nodeDescriptor == null) { return false; } return nodeDescriptor.getMacCapabilities().contains(MacCapabilitiesType.FULL_FUNCTION_DEVICE); }
/** * Returns true if the node is a Reduced Function Device. Returns false if not an RFD or logical type is unknown. * <p> * An RFD (Reduced Function Device) is a device that has a reduced level of functionality. * Typically it is an end node which may be typically a sensor or switch. RFDs can only talk to FFDs * as they contain no routing functionality. These devices can be very low power devices because they * do not need to route other traffic and they can be put into a sleep mode when they are not in use. * * @return true if the device is a Reduced Function Device */ public boolean isReducedFuntionDevice() { if (nodeDescriptor == null) { return false; } return nodeDescriptor.getMacCapabilities().contains(MacCapabilitiesType.REDUCED_FUNCTION_DEVICE); }
@Test public void testNodeDescriptor() { NodeDescriptor descriptor = new NodeDescriptor(0, 3333, 74, true, 6666, 0, 6, 4444, true, 8); assertTrue(descriptor.isComplexDescriptorAvailable()); assertTrue(descriptor.isUserDescriptorAvailable()); assertEquals(4444, descriptor.getIncomingTransferSize()); assertEquals(6666, descriptor.getManufacturerCode()); assertEquals(3333, descriptor.getBufferSize()); assertTrue(descriptor.getFrequencyBands().contains(FrequencyBandType.FREQ_2400_MHZ)); assertEquals(LogicalType.COORDINATOR, descriptor.getLogicalType()); assertEquals(0, descriptor.getApsFlags()); assertTrue(descriptor.getServerCapabilities().contains(ServerCapabilitiesType.PRIMARY_BINDING_TABLE_CACHE)); assertTrue(descriptor.getServerCapabilities().contains(ServerCapabilitiesType.BACKUP_TRUST_CENTER)); assertTrue(descriptor.getMacCapabilities().contains(MacCapabilitiesType.SECURITY_CAPABLE)); assertTrue(descriptor.getMacCapabilities().contains(MacCapabilitiesType.RECEIVER_ON_WHEN_IDLE)); assertTrue(descriptor.getMacCapabilities().contains(MacCapabilitiesType.FULL_FUNCTION_DEVICE)); }