Example #1
0
        protected Task <CommandResult> Send(ZclCommand command)
        {
            //command.DestinationAddress = _zigbeeEndpoint.GetEndpointAddress();
            if (IsClient())
            {
                command.CommandDirection = ZclCommandDirection.SERVER_TO_CLIENT;
            }

            return(_zigbeeEndpoint.SendTransaction(command, new ZclTransactionMatcher()));
        }
Example #2
0
        /**
         * Adds a binding from the cluster to the destination {@link ZigBeeEndpoint}.
         *
         * @param address the destination {@link IeeeAddress}
         * @param endpointId the destination endpoint ID
         * @return Command future
         */
        public Task <CommandResult> Bind(IeeeAddress address, byte endpointId)
        {
            BindRequest command = new BindRequest();

            command.DestinationAddress = new ZigBeeEndpointAddress(_zigbeeEndpoint.GetEndpointAddress().Address);
            command.SrcAddress         = _zigbeeEndpoint.GetIeeeAddress();
            command.SrcEndpoint        = _zigbeeEndpoint.EndpointId;
            command.BindCluster        = _clusterId;
            command.DstAddrMode        = 3; // 64 bit addressing
            command.DstAddress         = address;
            command.DstEndpoint        = endpointId;
            return(_zigbeeEndpoint.SendTransaction(command, new BindRequest()));
        }