|
Fast Research Interface Library
Manual and Documentation
|
00001 // ---------------------- Doxygen info ---------------------- 00051 // ---------------------------------------------------------- 00052 // For a convenient reading of this file's source code, 00053 // please use a tab width of four characters. 00054 // ---------------------------------------------------------- 00055 00056 00057 #include <FastResearchInterface.h> 00058 #include <pthread.h> 00059 #include <friComm.h> 00060 00061 00062 // **************************************************************** 00063 // GetFRICycleTime() 00064 // 00065 float FastResearchInterface::GetFRICycleTime(void) 00066 { 00067 float ReturnValue = 0.0; 00068 00069 pthread_mutex_lock(&(this->MutexForControlData)); 00070 ReturnValue = this->ReadData.intf.desiredCmdSampleTime; 00071 pthread_mutex_unlock(&(this->MutexForControlData)); 00072 00073 return(ReturnValue); 00074 } 00075 00076 00077 // **************************************************************** 00078 // GetCommunicationTimingQuality() 00079 // 00080 int FastResearchInterface::GetCommunicationTimingQuality(void) 00081 { 00082 int ReturnValue = 0; 00083 00084 pthread_mutex_lock(&(this->MutexForControlData)); 00085 ReturnValue = this->ReadData.intf.quality; 00086 pthread_mutex_unlock(&(this->MutexForControlData)); 00087 00088 return(ReturnValue); 00089 } 00090 00091 00092 // **************************************************************** 00093 // GetUDPAnswerRate() 00094 // 00095 float FastResearchInterface::GetUDPAnswerRate(void) 00096 { 00097 float ReturnValue = 0.0; 00098 00099 pthread_mutex_lock(&(this->MutexForControlData)); 00100 ReturnValue = this->ReadData.intf.stat.answerRate; 00101 pthread_mutex_unlock(&(this->MutexForControlData)); 00102 00103 return(ReturnValue); 00104 } 00105 00106 00107 // **************************************************************** 00108 // GetUDPLatencyInSeconds() 00109 // 00110 float FastResearchInterface::GetUDPLatencyInSeconds(void) 00111 { 00112 float ReturnValue = 0.0; 00113 00114 pthread_mutex_lock(&(this->MutexForControlData)); 00115 ReturnValue = this->ReadData.intf.stat.latency; 00116 pthread_mutex_unlock(&(this->MutexForControlData)); 00117 00118 return(ReturnValue); 00119 } 00120 00121 00122 // **************************************************************** 00123 // GetUDPJitterInSeconds() 00124 // 00125 float FastResearchInterface::GetUDPJitterInSeconds(void) 00126 { 00127 float ReturnValue = 0.0; 00128 00129 pthread_mutex_lock(&(this->MutexForControlData)); 00130 ReturnValue = this->ReadData.intf.stat.jitter; 00131 pthread_mutex_unlock(&(this->MutexForControlData)); 00132 00133 return(ReturnValue); 00134 } 00135 00136 00137 // **************************************************************** 00138 // GetUDPPackageLossRate() 00139 // 00140 float FastResearchInterface::GetUDPPackageLossRate(void) 00141 { 00142 float ReturnValue = 0.0; 00143 00144 pthread_mutex_lock(&(this->MutexForControlData)); 00145 ReturnValue = this->ReadData.intf.stat.missRate; 00146 pthread_mutex_unlock(&(this->MutexForControlData)); 00147 00148 return(ReturnValue); 00149 } 00150 00151 00152 // **************************************************************** 00153 // GetNumberOfMissedUDPPackages() 00154 // 00155 unsigned int FastResearchInterface::GetNumberOfMissedUDPPackages(void) 00156 { 00157 unsigned int ReturnValue = 0; 00158 00159 pthread_mutex_lock(&(this->MutexForControlData)); 00160 ReturnValue = this->ReadData.intf.stat.missCounter; 00161 pthread_mutex_unlock(&(this->MutexForControlData)); 00162 00163 return(ReturnValue); 00164 } 00165 00166 00167 // **************************************************************** 00168 // GetValueOfKRCSequenceCounter() 00169 // 00170 unsigned int FastResearchInterface::GetValueOfKRCSequenceCounter(void) 00171 { 00172 unsigned int ReturnValue = 0; 00173 00174 pthread_mutex_lock(&(this->MutexForControlData)); 00175 ReturnValue = this->ReadData.head.sendSeqCount; 00176 pthread_mutex_unlock(&(this->MutexForControlData)); 00177 00178 return(ReturnValue); 00179 }