public static bool LivelinessLostValid(DDS.IDataWriter writer, int totalCount, int
                                               totalCountChange)
        {
            bool result = false;

            DDS.LivelinessLostStatus holder = null;
            DDS.ReturnCode           rc     = writer.GetLivelinessLostStatus(ref holder);
            if (rc == DDS.ReturnCode.Ok)
            {
                DDS.LivelinessLostStatus status = holder;
                if (status.TotalCount == totalCount)
                {
                    if (status.TotalCountChange == totalCountChange)
                    {
                        result = true;
                    }
                    else
                    {
                        System.Console.Error.WriteLine("liveliness_lost.TotalCountChange != '" + totalCountChange
                                                       + "', but '" + status.TotalCountChange + "'.");
                    }
                }
                else
                {
                    System.Console.Error.WriteLine("liveliness_lost.TotalCount != '" + totalCount +
                                                   "', but '" + status.TotalCount + "'.");
                }
            }
            else
            {
                System.Console.Error.WriteLine("get_liveliness_lost_status returned " + rc);
            }
            return(result);
        }
Пример #2
0
 private void PrintStatusses(DDS.IDataWriter writer)
 {
     DDS.ReturnCode rc;
     DDS.OfferedDeadlineMissedStatus odsHolder = null;
     rc = writer.GetOfferedDeadlineMissedStatus(ref odsHolder);
     DDS.OfferedDeadlineMissedStatus ods = odsHolder;
     if (rc != DDS.ReturnCode.Ok)
     {
         System.Console.Error.WriteLine("Unable to resolve status!");
         return;
     }
     DDS.OfferedIncompatibleQosStatus oisHolder = null;
     rc = writer.GetOfferedIncompatibleQosStatus(ref oisHolder);
     DDS.OfferedIncompatibleQosStatus ois = oisHolder;
     if (rc != DDS.ReturnCode.Ok)
     {
         System.Console.Error.WriteLine("Unable to resolve status!");
         return;
     }
     DDS.LivelinessLostStatus llsHolder = null;
     rc = writer.GetLivelinessLostStatus(ref llsHolder);
     DDS.LivelinessLostStatus lls = llsHolder;
     if (rc != DDS.ReturnCode.Ok)
     {
         System.Console.Error.WriteLine("Unable to resolve status!");
         return;
     }
     DDS.PublicationMatchedStatus pmsHolder = null;
     rc = writer.GetPublicationMatchedStatus(ref pmsHolder);
     DDS.PublicationMatchedStatus pms = pmsHolder;
     if (rc != DDS.ReturnCode.Ok)
     {
         System.Console.Error.WriteLine("Unable to resolve status!");
         return;
     }
     System.Console.Out.WriteLine("offered_deadline_missed.TotalCount           : " +
                                  ods.TotalCount);
     System.Console.Out.WriteLine("offered_deadline_missed.TotalCountChange    : " +
                                  ods.TotalCountChange);
     System.Console.Out.WriteLine("offered_deadline_missed.LastInstanceHandle  : " +
                                  ods.LastInstanceHandle);
     System.Console.Out.WriteLine("offered_incompatible_qos.TotalCount          : " +
                                  ois.TotalCount);
     System.Console.Out.WriteLine("offered_incompatible_qos.TotalCountChange   : " +
                                  ois.TotalCountChange);
     System.Console.Out.WriteLine("offered_incompatible_qos.LastPolicyId       : " +
                                  ois.LastPolicyId);
     System.Console.Out.WriteLine("liveliness_lost.TotalCount                   : " +
                                  lls.TotalCount);
     System.Console.Out.WriteLine("liveliness_lost.TotalCountChange            : " +
                                  lls.TotalCountChange);
     System.Console.Out.WriteLine("publication_matched.TotalCount               : " +
                                  pms.TotalCount);
     System.Console.Out.WriteLine("publication_matched.TotalCountChange        : " +
                                  pms.TotalCountChange);
     System.Console.Out.WriteLine("publication_matched.LastSubscriptionHandle  : " +
                                  pms.LastSubscriptionHandle);
 }
Пример #3
0
 public virtual void Reset()
 {
     onOfferedDeadlineMissedCalled = false;
     odmStatus = new DDS.OfferedDeadlineMissedStatus();
     onOfferedIncompatibleQosCalled = false;
     oiqStatus = new DDS.OfferedIncompatibleQosStatus();
     onLivelinessLostCalled = false;
     llStatus = new DDS.LivelinessLostStatus();
     onPublicationMatchStatus = false;
     pmStatus = new DDS.PublicationMatchedStatus();
 }
Пример #4
0
        public override void OnLivelinessLost(DDS.IDataWriter writer, DDS.LivelinessLostStatus status)
        {
            onLivelinessLostCalled = true;
            llStatus = status;
            Semaphore sem = null;

            if (semaphores.TryGetValue(DDS.StatusKind.LivelinessLost, out sem) == true)
            {
                sem.Release();
            }
        }
Пример #5
0
 public virtual void Reset()
 {
     onOfferedDeadlineMissedCalled = false;
     odmStatus = new DDS.OfferedDeadlineMissedStatus();
     onOfferedIncompatibleQosCalled = false;
     oiqStatus = new DDS.OfferedIncompatibleQosStatus();
     onLivelinessLostCalled = false;
     llStatus = new DDS.LivelinessLostStatus();
     onPublicationMatchStatus = false;
     pmStatus = new DDS.PublicationMatchedStatus();
 }
 public override void Reset()
 {
     base.Reset();
     onOfferedDeadlineMissedCalled = false;
     odmStatus = new DDS.OfferedDeadlineMissedStatus();
     onOfferedIncompatibleQosCalled = false;
     oiqStatus = new DDS.OfferedIncompatibleQosStatus();
     onLivelinessLostCalled = false;
     llStatus = new DDS.LivelinessLostStatus();
     onPublicationMatchStatus = false;
     pmStatus = new DDS.PublicationMatchedStatus();
     onInconsistentTopicCalled = false;
     ictStatus = new DDS.InconsistentTopicStatus();
 }
Пример #7
0
 public override void Reset()
 {
     base.Reset();
     onOfferedDeadlineMissedCalled = false;
     odmStatus = new DDS.OfferedDeadlineMissedStatus();
     onOfferedIncompatibleQosCalled = false;
     oiqStatus = new DDS.OfferedIncompatibleQosStatus();
     onLivelinessLostCalled = false;
     llStatus = new DDS.LivelinessLostStatus();
     onPublicationMatchStatus = false;
     pmStatus = new DDS.PublicationMatchedStatus();
     onInconsistentTopicCalled = false;
     ictStatus = new DDS.InconsistentTopicStatus();
 }
Пример #8
0
        public override Test.Framework.TestResult Run()
        {
            mod.tstDataWriter                datawriter;
            DDS.ReturnCode                   rc;
            DDS.LivelinessLostStatus         llStatus  = null;
            DDS.OfferedDeadlineMissedStatus  odmStatus = null;
            DDS.OfferedIncompatibleQosStatus oiqStatus = null;
            DDS.PublicationMatchedStatus     pmStatus  = null;
            string expResult = "DataWriter status test succeeded";

            Test.Framework.TestResult result;
            result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
                                                   Test.Framework.TestVerdict.Fail);
            datawriter = (mod.tstDataWriter) this.ResolveObject("datawriter");
            rc         = datawriter.GetLivelinessLostStatus(ref llStatus);
            if (DDS.ReturnCode.Ok != rc)
            {
                result.Result = string.Format("LivelinessLostStatus could not be resolved. ReturnCode: {0}", rc);
                return(result);
            }
            rc = datawriter.GetOfferedDeadlineMissedStatus(ref odmStatus);
            if (DDS.ReturnCode.Ok != rc)
            {
                result.Result = string.Format("OfferedDeadlineMissedStatus could not be resolved. ReturnCode: {0}", rc);
                return(result);
            }
            rc = datawriter.GetOfferedIncompatibleQosStatus(ref oiqStatus);
            if (DDS.ReturnCode.Ok != rc)
            {
                result.Result = string.Format("OfferedIncompatibleStatus could not be resolved. ReturnCode: {0}", rc);
                return(result);
            }
            rc = datawriter.GetPublicationMatchedStatus(ref pmStatus);
            if (DDS.ReturnCode.Ok != rc)
            {
                result.Result = string.Format("OfferedIncompatibleStatus could not be resolved. ReturnCode: {0}", rc);
                return(result);
            }
            result.Result  = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return(result);
        }
 void DDS.IDataWriterListener.OnLivelinessLost(DDS.IDataWriter entityInterface, DDS.LivelinessLostStatus status)
 {
     onLivelinessLostCalled = true;
     llStatus = status;
 }
Пример #10
0
 void DDS.IDataWriterListener.OnLivelinessLost(DDS.IDataWriter entityInterface, DDS.LivelinessLostStatus status)
 {
     onLivelinessLostCalled = true;
     llStatus = status;
 }
Пример #11
0
 public override void OnLivelinessLost(DDS.IDataWriter writer, DDS.LivelinessLostStatus status)
 {
     onLivelinessLostCalled = true;
     llStatus = status;
 }