Search in sources :

Example 1 with EzspAddEndpointRequest

use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspAddEndpointRequest in project com.zsmartsystems.zigbee by zsmartsystems.

the class EmberNcp method addEndpoint.

/**
 * Configures endpoint information on the NCP. The NCP does not remember these settings after a reset. Endpoints can
 * be added by the Host after the NCP has reset. Once the status of the stack changes to EMBER_NETWORK_UP, endpoints
 * can no longer be added and this command will respond with EZSP_ERROR_INVALID_CALL.
 *
 * @param endpointId the endpoint number to add
 * @param deviceId the device id for the endpoint
 * @param profileId the profile id
 * @param inputClusters an array of input clusters supported by the endpoint
 * @param outputClusters an array of output clusters supported by the endpoint
 * @return the {@link EzspStatus} of the response
 */
public EzspStatus addEndpoint(int endpointId, int deviceId, int profileId, int[] inputClusters, int[] outputClusters) {
    EzspAddEndpointRequest request = new EzspAddEndpointRequest();
    request.setEndpoint(endpointId);
    request.setDeviceId(deviceId);
    request.setProfileId(profileId);
    request.setInputClusterList(new int[] { 0 });
    request.setOutputClusterList(new int[] { 0 });
    EzspTransaction transaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(request, EzspAddEndpointResponse.class));
    EzspAddEndpointResponse response = (EzspAddEndpointResponse) transaction.getResponse();
    logger.debug(response.toString());
    lastStatus = null;
    return response.getStatus();
}
Also used : EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction) EzspAddEndpointRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspAddEndpointRequest) EzspAddEndpointResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspAddEndpointResponse)

Aggregations

EzspAddEndpointRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspAddEndpointRequest)1 EzspAddEndpointResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspAddEndpointResponse)1 EzspSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)1 EzspTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction)1