Example #1
0
        /// <summary>
        /// Adds a binding from the cluster to the destination <see cref="ZigBeeEndpoint">.
        ///
        /// <param name="address">the destination <see cref="IeeeAddress"></param>
        /// <param name="endpointId">the destination endpoint ID</param>
        /// <returns>command Task</returns>
        /// </summary>
        public Task <CommandResult> Bind(IeeeAddress address, ushort networkAddress, byte endpointId)
        {
            BindRequest command = new BindRequest();

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