Search in sources :

Example 6 with ConBeeReadParameterResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ConBeeReadParameterResponseTest method readPanId.

@Test
public void readPanId() {
    ConBeeReadParameterResponse readParameter = new ConBeeReadParameterResponse(new int[] { 0x0A, 0x04, 0x00, 0x0A, 0x00, 0x03, 0x00, 0x05, 0xD1, 0x06, 0x09, 0xFF });
    System.out.println(readParameter);
    assertEquals(4, readParameter.getSequence());
    assertEquals(ConBeeStatus.SUCCESS, readParameter.getStatus());
    assertEquals(ConBeeNetworkParameter.NWK_PANID, readParameter.getParameter());
    assertEquals(new Integer(0x06D1), readParameter.getValue());
    assertEquals(0x06D1, readParameter.getValue());
}
Also used : ConBeeReadParameterResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse) Test(org.junit.Test)

Example 7 with ConBeeReadParameterResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ConBeeReadParameterResponseTest method readApsExtendedPanId.

@Test
public void readApsExtendedPanId() {
    ConBeeReadParameterResponse readParameter = new ConBeeReadParameterResponse(new int[] { 0x0A, 0x05, 0x00, 0x10, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0xFF });
    System.out.println(readParameter);
    assertEquals(5, readParameter.getSequence());
    assertEquals(ConBeeStatus.SUCCESS, readParameter.getStatus());
    assertEquals(ConBeeNetworkParameter.APS_EXTENDED_PANID, readParameter.getParameter());
    assertEquals(new ExtendedPanId("0000000000000000"), readParameter.getValue());
}
Also used : ExtendedPanId(com.zsmartsystems.zigbee.ExtendedPanId) ConBeeReadParameterResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse) Test(org.junit.Test)

Example 8 with ConBeeReadParameterResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeDongleConBee method getZigBeePanId.

@Override
public int getZigBeePanId() {
    ConBeeReadParameterRequest readParameter = new ConBeeReadParameterRequest();
    readParameter.setParameter(ConBeeNetworkParameter.NWK_PANID);
    ConBeeReadParameterResponse response = (ConBeeReadParameterResponse) conbeeHandler.sendTransaction(new ConBeeSingleResponseTransaction(readParameter, ConBeeReadParameterResponse.class)).getResponse();
    return (int) response.getValue();
}
Also used : ConBeeSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeSingleResponseTransaction) ConBeeReadParameterResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse) ConBeeReadParameterRequest(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterRequest)

Example 9 with ConBeeReadParameterResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeDongleConBee method getZigBeeChannel.

@Override
public int getZigBeeChannel() {
    ConBeeReadParameterRequest readParameter = new ConBeeReadParameterRequest();
    readParameter.setParameter(ConBeeNetworkParameter.CURRENT_CHANNEL);
    ConBeeReadParameterResponse response = (ConBeeReadParameterResponse) conbeeHandler.sendTransaction(new ConBeeSingleResponseTransaction(readParameter, ConBeeReadParameterResponse.class)).getResponse();
    return (int) response.getValue();
}
Also used : ConBeeSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeSingleResponseTransaction) ConBeeReadParameterResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse) ConBeeReadParameterRequest(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterRequest)

Example 10 with ConBeeReadParameterResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeDongleConBee method getZigBeeExtendedPanId.

@Override
public ExtendedPanId getZigBeeExtendedPanId() {
    ConBeeReadParameterRequest readParameter = new ConBeeReadParameterRequest();
    readParameter.setParameter(ConBeeNetworkParameter.NWK_EXTENDED_PANID);
    ConBeeReadParameterResponse response = (ConBeeReadParameterResponse) conbeeHandler.sendTransaction(new ConBeeSingleResponseTransaction(readParameter, ConBeeReadParameterResponse.class)).getResponse();
    return (ExtendedPanId) response.getValue();
}
Also used : ConBeeSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeSingleResponseTransaction) ExtendedPanId(com.zsmartsystems.zigbee.ExtendedPanId) ConBeeReadParameterResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse) ConBeeReadParameterRequest(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterRequest)

Aggregations

ConBeeReadParameterResponse (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterResponse)10 Test (org.junit.Test)6 ConBeeReadParameterRequest (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeReadParameterRequest)4 ConBeeSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeSingleResponseTransaction)4 ExtendedPanId (com.zsmartsystems.zigbee.ExtendedPanId)3 IeeeAddress (com.zsmartsystems.zigbee.IeeeAddress)1 ConBeeFrameHandler (com.zsmartsystems.zigbee.dongle.conbee.internal.ConBeeFrameHandler)1 ConBeeDeviceStateRequest (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeDeviceStateRequest)1 ConBeeDeviceStateResponse (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeDeviceStateResponse)1 ConBeeVersionRequest (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeVersionRequest)1 ConBeeVersionResponse (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeVersionResponse)1