public override bool Equals(object obj) { DriCasCardStatus cardStatus = obj as DriCasCardStatus; if (cardStatus != null && this == cardStatus) { return(true); } return(false); }
/// <summary> /// Upon receipt of the GetCardStatus action, the DRIT SHALL retrieve fromthe Card all the necessary information to /// respond with updated information in less than 1s. /// </summary> /// <param name="currentCardStatus">This argument provides the value of the CardStatus state variable when the action response is created.</param> /// <param name="currentCardManufacturer">This argument provides the value of the CardManufacturer state variable when the action response is created.</param> /// <param name="currentCardVersion">This argument provides the value of the CardVersion state variable when the action response is created.</param> /// <param name="currentDaylightSaving">This argument provides the value of the DaylightSaving state variable when the action response is created.</param> /// <param name="currentEaLocationCode">This argument provides the value of the EALocationCode state variable when the action response is created.</param> /// <param name="currentRatingRegion">This argument provides the value of the RatingRegion state variable when the action response is created.</param> /// <param name="currentTimeZone">This argument provides the value of the TimeZone state variable when the action response is created.</param> public void GetCardStatus(out DriCasCardStatus currentCardStatus, out string currentCardManufacturer, out string currentCardVersion, out bool currentDaylightSaving, out UInt32 currentEaLocationCode, out byte currentRatingRegion, out Int32 currentTimeZone) { IList <object> outParams = _getCardStatusAction.InvokeAction(null); currentCardStatus = (DriCasCardStatus)(string)outParams[0]; currentCardManufacturer = (string)outParams[1]; currentCardVersion = (string)outParams[2]; currentDaylightSaving = (bool)outParams[3]; currentEaLocationCode = (uint)outParams[4]; currentRatingRegion = (byte)outParams[5]; currentTimeZone = (int)outParams[6]; }
/// <summary> /// Upon receipt of the GetCardStatus action, the DRIT SHALL retrieve fromthe Card all the necessary information to /// respond with updated information in less than 1s. /// </summary> /// <param name="currentCardStatus">This argument provides the value of the CardStatus state variable when the action response is created.</param> /// <param name="currentCardManufacturer">This argument provides the value of the CardManufacturer state variable when the action response is created.</param> /// <param name="currentCardVersion">This argument provides the value of the CardVersion state variable when the action response is created.</param> /// <param name="currentDaylightSaving">This argument provides the value of the DaylightSaving state variable when the action response is created.</param> /// <param name="currentEaLocationCode">This argument provides the value of the EALocationCode state variable when the action response is created.</param> /// <param name="currentRatingRegion">This argument provides the value of the RatingRegion state variable when the action response is created.</param> /// <param name="currentTimeZone">This argument provides the value of the TimeZone state variable when the action response is created.</param> public void GetCardStatus(out DriCasCardStatus currentCardStatus, out string currentCardManufacturer, out string currentCardVersion, out bool currentDaylightSaving, out UInt32 currentEaLocationCode, out byte currentRatingRegion, out Int32 currentTimeZone) { IList<object> outParams = _getCardStatusAction.InvokeAction(null); currentCardStatus = (DriCasCardStatus)(string)outParams[0]; currentCardManufacturer = (string)outParams[1]; currentCardVersion = (string)outParams[2]; currentDaylightSaving = (bool)outParams[3]; currentEaLocationCode = (uint)outParams[4]; currentRatingRegion = (byte)outParams[5]; currentTimeZone = (int)outParams[6]; }
/// <summary> /// Handle UPnP evented state variable changes. /// </summary> /// <param name="stateVariable">The state variable that has changed.</param> /// <param name="newValue">The new value of the state variable.</param> private void OnStateVariableChanged(CpStateVariable stateVariable, object newValue) { try { if (stateVariable.Name.Equals("PCRLock") || stateVariable.Name.Equals("Lock")) { _tunerLocked = (bool)newValue; if (_eventSignalLock != null) { _eventSignalLock.Set(); } } else if (stateVariable.Name.Equals("CardStatus")) { DriCasCardStatus oldStatus = _cardStatus; _cardStatus = (DriCasCardStatus)(string)newValue; if (oldStatus != _cardStatus) { Log.Log.Info("DRI CC: device {0} CableCARD status update, old status = {1}, new status = {2}", _cardId, oldStatus, _cardStatus); } } else if (stateVariable.Name.Equals("CardMessage")) { if (!string.IsNullOrEmpty(newValue.ToString())) { Log.Log.Info("DRI CC: device {0} received message from the CableCARD, current status = {1}, message = {2}", _cardId, _cardStatus, newValue); } } else if (stateVariable.Name.Equals("MMIMessage")) { HandleMmiMessage((byte[])newValue); } else if (stateVariable.Name.Equals("DescramblingStatus")) { DriCasDescramblingStatus oldStatus = _descramblingStatus; _descramblingStatus = (DriCasDescramblingStatus)(string)newValue; if (oldStatus != _descramblingStatus) { Log.Log.Info("DRI CC: device {0} descrambling status update, old status = {1}, new status = {2}", _cardId, oldStatus, _descramblingStatus); } } else if (stateVariable.Name.Equals("DrmPairingStatus")) { DriSecurityPairingStatus oldStatus = _pairingStatus; _pairingStatus = (DriSecurityPairingStatus)(string)newValue; if (oldStatus != _pairingStatus) { Log.Log.Info("DRI CC: device {0} pairing status update, old status = {1}, new status = {2}", _cardId, oldStatus, _pairingStatus); } } else { Log.Log.Debug("DRI CC: device {0} state variable {1} for service {2} changed to {3}", _cardId, stateVariable.Name, stateVariable.ParentService.FullQualifiedName, newValue ?? "[null]"); } } catch (Exception ex) { Log.Log.Error("DRI CC: failed to handle state variable change\r\n{0}", ex); } }