示例#1
0
 public WakeupSupport(NetworkViewPoint network, TransmitOptions txOptions)
     : base(0, 0, new ByteIndex(COMMAND_CLASS_WAKE_UP_V2.ID))
 {
     _wakeupDelay = new byte[] { 0x00, 0x01, 0x2C }; //300 sec
     _network     = network;
     TxOptions    = txOptions;
 }
示例#2
0
 public BasicSupport(NetworkViewPoint network, TransmitOptions txOptions)
     : base(0, 0, new ByteIndex(COMMAND_CLASS_BASIC.ID))
 {
     _network     = network;
     TxOptions    = txOptions;
     TxOptions2   = TransmitOptions2.TRANSMIT_OPTION_2_TRANSPORT_SERVICE;
     TxSecOptions = TransmitSecurityOptions.S2_TXOPTION_VERIFY_DELIVERY;
 }
示例#3
0
 public ResponseDataExOperation(NetworkViewPoint network, ResponseExDataDelegate receiveCallback, TransmitOptions txOptions, TransmitSecurityOptions txSecOptions, TransmitOptions2 txOptions2, byte destNodeId, byte cmdClass, byte cmd)
     : base(destNodeId, 0, new ByteIndex(cmdClass), new ByteIndex(cmd))
 {
     _network          = network;
     ReceiveExCallback = receiveCallback;
     TxOptions         = txOptions;
     TxSecOptions      = txSecOptions;
     TxOptions2        = txOptions2;
 }
示例#4
0
 public SmartStartSupport(NetworkViewPoint network, Action <NodeStatuses> setNodeStatusSignal, Func <byte[], Tuple <byte, byte[], int> > dskNeededCallback, Action <bool, byte[], ActionResult> busyCallback, int timeoutMs)
     : base(false, null, false)
 {
     _network             = network;
     _busyCallback        = busyCallback;
     _setNodeStatusSignal = setNodeStatusSignal;
     _dskNeededCallback   = dskNeededCallback;
     _timeoutMs           = timeoutMs;
 }
示例#5
0
 public ResponseDataExOperation(NetworkViewPoint network, byte[] data, TransmitOptions txOptions, TransmitSecurityOptions txSecOptions, TransmitOptions2 txOptions2, byte destNodeId, byte cmdClass, byte cmd)
     : base(destNodeId, 0, new ByteIndex(cmdClass), new ByteIndex(cmd))
 {
     _network = network;
     Data     = new List <byte[]>();
     Data.Add(data);
     TxOptions    = txOptions;
     TxSecOptions = txSecOptions;
     TxOptions2   = txOptions2;
 }
示例#6
0
        /// <summary>
        /// Over The Air support task.
        /// Firmaware Update Meta Data version 5
        /// </summary>
        public FirmwareUpdateMdSupport(NetworkViewPoint network, TransmitOptions txOptions, Action SetNewImageCompletedCallback)
            : base(0, 0, new ByteIndex(COMMAND_CLASS_FIRMWARE_UPDATE_MD_V5.ID))
        {
            _network     = network;
            TxOptions    = txOptions;
            TxOptions2   = TransmitOptions2.TRANSMIT_OPTION_2_TRANSPORT_SERVICE;
            TxSecOptions = TransmitSecurityOptions.S2_TXOPTION_VERIFY_DELIVERY;

            _setNewImageCompletedCallback = SetNewImageCompletedCallback;
        }
示例#7
0
 public ResponseDataExOperation(NetworkViewPoint network, List <byte[]> data, TransmitOptions txOptions, TransmitSecurityOptions txSecOptions, SecuritySchemes scheme, TransmitOptions2 txOptions2, byte destNodeId, byte cmdClass, byte cmd)
     : base(destNodeId, 0, new ByteIndex(cmdClass), new ByteIndex(cmd))
 {
     _network                  = network;
     Data                      = data;
     TxOptions                 = txOptions;
     TxSecOptions              = txSecOptions;
     SecurityScheme            = scheme;
     TxOptions2                = txOptions2;
     IsSecuritySchemeSpecified = true;
 }
示例#8
0
        public MultiChannelAssociationSupport(NetworkViewPoint network, TransmitOptions txOptions)
            : base(0, 0, new ByteIndex(COMMAND_CLASS_MULTI_CHANNEL_ASSOCIATION_V3.ID))
        {
            _groupId           = 0x01;
            _groupName         = "Lifeline";
            _associatedNodeIds = new List <byte>();
            _maxNodesSupported = 0xE8;

            _network  = network;
            TxOptions = txOptions;
        }
 public AssociationGroupInfoSupport(NetworkViewPoint network, TransmitOptions txOptions)
     : base(0, 0, new ByteIndex(COMMAND_CLASS_ASSOCIATION_GRP_INFO_V3.ID))
 {
     _network          = network;
     GroupId           = 0x01;
     GroupName         = "Lifeline";
     AssociatedNodeIds = new List <byte>();
     TxOptions         = txOptions;
     TxOptions2        = TransmitOptions2.TRANSMIT_OPTION_2_TRANSPORT_SERVICE;
     TxSecOptions      = TransmitSecurityOptions.S2_TXOPTION_VERIFY_DELIVERY;
 }
示例#10
0
 public ResponseDataExOperation(NetworkViewPoint network, byte[] data, TransmitOptions txOptions, TransmitSecurityOptions txSecOptions,
                                TransmitOptions2 txOptions2, byte destNodeId, int NumBytesToCompare
                                , byte cmdClass, byte[] cmd)
     : base(destNodeId, 0, cmd, NumBytesToCompare)
 {
     _network = network;
     Data     = new List <byte[]>();
     Data.Add(data);
     TxOptions    = txOptions;
     TxSecOptions = txSecOptions;
     TxOptions2   = txOptions2;
 }
示例#11
0
        public MultiChannelSupport(NetworkViewPoint network, TransmitOptions txOptions)
            : base(0, 0, new ByteIndex(COMMAND_CLASS_MULTI_CHANNEL_V4.ID))
        {
            _groupId           = 0x01;
            _groupName         = "Lifeline";
            _associatedNodeIds = new List <byte> [END_POINTS_COUNT];
            for (int i = 0; i < END_POINTS_COUNT; i++)
            {
                _associatedNodeIds[i] = new List <byte>();
            }
            _maxNodesSupported = 0xE8;

            _network  = network;
            TxOptions = txOptions;
        }
示例#12
0
 internal SecurityManagerInfo(NetworkViewPoint network, NetworkKey[] networkKeys, byte[] privateKey)
 {
     _nvrSecretKeyS2 = privateKey;
     Network         = network;
     _nodesMask      = new byte[NetworkViewPoint.MAX_NODES];
     for (int i = 0; i < _nodesMask.Length; i++)
     {
         _nodesMask[i] = (byte)(i + 1);
     }
     Network.EnableSecuritySchemeSettingsChanged += Network_S2SchemeSettingsChanged;
     _networkKeys = networkKeys;
     MpanTable    = new MpanTable();
     SpanTable    = new SpanTable();
     ScKeys       = new Dictionary <InvariantPeerNodeId, SinglecastKey>();
     McKeys       = new Dictionary <NodeGroupId, MulticastKey>();
 }
示例#13
0
        protected bool IsSupportedScheme(NetworkViewPoint network, byte[] command, SecuritySchemes scheme)
        {
            bool ret = false;

            if (command != null && command.Length > 0)
            {
                if (scheme == SecuritySchemes.NONE && !network.HasNetworkAwareCommandClass(command[0]) && network.HasSecurityScheme(SecuritySchemeSet.ALL))
                {
                    ret = !network.HasSecureCommandClass(command[0]);
                }
                else
                {
                    ret = true;
                }
            }
            return(ret);
        }
示例#14
0
        public SetupNodeLifelineTask(NetworkViewPoint network) :
            base()
        {
            _network       = network;
            WakeUpInterval = 5 * 60; // In Seconds.
            IsFullSetup    = true;

            _requestNodeInfo = new NodeInfoTask(_network, 0);
            _requestRoleType = new RequestDataOperation(0, 0,
                                                        new COMMAND_CLASS_ZWAVEPLUS_INFO_V2.ZWAVEPLUS_INFO_GET(), _txOptions,
                                                        new COMMAND_CLASS_ZWAVEPLUS_INFO_V2.ZWAVEPLUS_INFO_REPORT(), 2,
                                                        10000)
            {
                Name = "ReguestData (ZWavePlus)"
            };
            _deleteReturnRoute                 = new DeleteReturnRouteOperation(0);
            _assignReturnRoute                 = new AssignReturnRouteOperation(0, 0);
            _sendAssociationCreate             = new SendDataOperation(0, null, _txOptions);
            _sendMultichannelAssociationCreate = new SendDataOperation(0, null, _txOptions);
            _requestWakeUpCapabilities         = new RequestDataOperation(0, 0,
                                                                          new COMMAND_CLASS_WAKE_UP_V2.WAKE_UP_INTERVAL_CAPABILITIES_GET(), _txOptions,
                                                                          new COMMAND_CLASS_WAKE_UP_V2.WAKE_UP_INTERVAL_CAPABILITIES_REPORT(), 2,
                                                                          2000)
            {
                Name = "ReguestData (WakeUpCapabilites)"
            };
            _sendWakeUpInterval = new SendDataOperation(0, null, _txOptions);

            SpecificResult.NodeInfo          = _requestNodeInfo.SpecificResult;
            SpecificResult.SetWakeUpInterval = _sendWakeUpInterval.SpecificResult;
            SpecificResult.RequestRoleType   = _requestRoleType.SpecificResult;

            Actions = new ActionBase[] {
                _requestNodeInfo,
                _requestRoleType,
                _deleteReturnRoute,
                _assignReturnRoute,
                _sendAssociationCreate,
                _sendMultichannelAssociationCreate,
                _requestWakeUpCapabilities,
                _sendWakeUpInterval
            };

            _onActionCompleted = OnActionCompleted;
        }
示例#15
0
        public NodeInfoTask(NetworkViewPoint network, byte nodeId)
        {
            _network = network;

            _nodeInfo = new RequestNodeInfoOperation(nodeId);
            _nodeInfoSecondAttempt = new RequestNodeInfoOperation(nodeId);

            _requestEndPoints = new RequestDataOperation(0, nodeId, new COMMAND_CLASS_MULTI_CHANNEL_V4.MULTI_CHANNEL_END_POINT_GET(), _txOptions,
                                                         new COMMAND_CLASS_MULTI_CHANNEL_V4.MULTI_CHANNEL_END_POINT_REPORT(), 2, 5000);

            _requestEndPointsCapabilities = new ActionSerialGroup();

            SpecificResult.RequestNodeInfo = _nodeInfo.SpecificResult;

            Actions = new ActionBase[]
            {
                _nodeInfo,
                _nodeInfoSecondAttempt,
                _requestEndPoints,
                _requestEndPointsCapabilities,
            };
        }
示例#16
0
 public InclusionTask(NetworkViewPoint network, IAddRemoveNode addRemoveNode)
     : this(network, addRemoveNode, false)
 {
 }
示例#17
0
        public InclusionTask(NetworkViewPoint network, IAddRemoveNode addRemoveNode, bool IsSmartStart)
            : base(false, null)
        {
            _network      = network;
            _isSmartStart = IsSmartStart;
            if (addRemoveNode is AddNodeOperation)
            {
                _mode = (addRemoveNode as AddNodeOperation).InitMode;
                _nodeStatusCallback = (addRemoveNode as AddNodeOperation).NodeStatusCallback;
                _timeoutMs          = (addRemoveNode as AddNodeOperation).TimeoutMs;
            }
            else
            {
                _mode      = Modes.NodeAny;
                _timeoutMs = TIMEOUT;
            }

            _peerFilter = new FilterAchOperation();
            _peerFilter.SetFilterNodeId(0xFF);
            _addNode = addRemoveNode;
            _addNode.NodeStatusCallback = OnNodeStatus;

            _memoryGetId = new MemoryGetIdOperation();

            _getSucNodeId             = new GetSucNodeIdOperation();
            _isFailedSucNodeOperation = new IsFailedNodeOperation(0);
            _getSucNodeInfo           = new RequestNodeInfoOperation(0);
            _requestSucNodeInfoGroup  = new ActionSerialGroup(OnSucNodeInfoCompletedGroup, _getSucNodeId, _isFailedSucNodeOperation, _getSucNodeInfo)
            {
                Name = "RequestSucNodeInfoGroup (InclusionController)",
                CompletedCallback = OnRequestSucNodeInfoGroupCompleted
            };

            _setupNodeLifelineTask = new SetupNodeLifelineTask(_network);

            _requestInclusionController = new InclusionController.Initiate(0, 0, _txOptions, 240000)
            {
                Name = "ReguestData (InclusionController)"
            };
            _serialApiGetInitData = new SerialApiGetInitDataOperation();

            SpecificResult.AddRemoveNode     = _addNode.SpecificResult;
            SpecificResult.MemoryGetId       = _memoryGetId.SpecificResult;
            SpecificResult.GetSucNodeId      = _getSucNodeId.SpecificResult;
            SpecificResult.NodeInfo          = _setupNodeLifelineTask.SpecificResult.NodeInfo;
            SpecificResult.SetWakeUpInterval = _setupNodeLifelineTask.SpecificResult.SetWakeUpInterval;

            _isFailedNodeOperation       = new IsFailedNodeOperation(_addNode.SpecificResult.Id);
            _removeFailedNodeIdOperation = new RemoveFailedNodeIdOperation(_addNode.SpecificResult.Id);
            if (!_isSmartStart)
            {
                _isFailedNodeOperation.Token.SetCancelled();
                _removeFailedNodeIdOperation.Token.SetCancelled();
            }

            Actions = new ActionBase[]
            {
                _peerFilter,
                new ActionSerialGroup(OnActionCompleted,
                                      _memoryGetId,
                                      _requestSucNodeInfoGroup,
                                      _serialApiGetInitData,
                                      (ActionBase)_addNode,
                                      _isFailedNodeOperation,
                                      _removeFailedNodeIdOperation,
                                      _requestInclusionController,
                                      _setupNodeLifelineTask
                                      )
                {
                    Name = "Inclusion (Group)"
                }
            };
        }
示例#18
0
 public PowerLevelSupport(NetworkViewPoint network)
     : base(0, 0, new ByteIndex(COMMAND_CLASS_POWERLEVEL.ID))
 {
     _network = network;
 }