資源簡介
TRDP(Train Real-time Data Protocol)協議,用于軌道交通實時以太網絡,對于鐵路用以太網,提高實時性、確保可靠性也是必不可少的條件。研究表明,鐵路控制系統需要確保延遲時間在50ms左右,使用以太網TRDP協議即可滿足這一要求。標準將通過行業團體“TCNOpen”,以開源的形式公開。其目的在于促進相應產品的開發,以及鐵路用以太網的普及,同時削減鐵路運營商和鐵路車輛企業采購構件的成本。
代碼片段和文件信息
/**********************************************************************************************************************/
/**
?*?@file????????????echoPolling.c
?*
?*?@brief???????????Demo?echoing?application?for?TRDP
?*
?*?@details????????????Receive?and?send?process?data?single?threaded?polling?static?memory
?*
?*?@note????????????Project:?TCNOpen?TRDP?prototype?stack
?*
?*?@author??????????Bernd?Loehr?NewTec?GmbH
?*
?*?@remarks?This?Source?Code?Form?is?subject?to?the?terms?of?the?Mozilla?Public?License?v.?2.0.?
?*??????????If?a?copy?of?the?MPL?was?not?distributed?with?this?file?You?can?obtain?one?at?http://mozilla.org/MPL/2.0/.
?*??????????Copyright?Bombardier?Transportation?Inc.?or?its?subsidiaries?and?others?2013.?All?rights?reserved.
?*
?*?$Id:?echoPolling.c?1455?2015-10-16?16:20:47Z?bloehr?$*
?*
?*/
/***********************************************************************************************************************
?*?INCLUDES
?*/
#include?
#include?
#include?
#if?defined?(POSIX)
#include?
#include?
#elif?defined?(WIN32)
#include?“getopt.h“
#endif
#include?“trdp_if.h“
#include?“vos_thread.h“
/*?Some?sample?comId?definitions????*/
/*?Expect?receiving:????*/
#define?PD_COMID1???????????????1000
#define?PD_COMID1_CYCLE?????????1000000
#define?PD_COMID1_TIMEOUT???????3000000?????????/*?3?s????*/
#define?PD_COMID1_DATA_SIZE?????32
#define?PD_COMID1_SRC_IP????????0x0?????????????/*????Sender‘s?IP:?10.0.0.100????????*/
/*?Send?as?echo:????*/
#define?PD_COMID2???????????????2001
#define?PD_COMID2_CYCLE?????????100000
#define?PD_COMID2_TIMEOUT???????1200000
#define?PD_COMID2_DATA_SIZE?????32
#define?PD_COMID2_DST_IP????????PD_COMID1_SRC_IP
/*?We?use?static?memory????*/
#define?RESERVED_MEMORY??1000000
UINT8???gMemoryArea[RESERVED_MEMORY];
CHAR8???gBuffer[32]?=?“Hello?World“;
/**********************************************************************************************************************/
/**?callback?routine?for?TRDP?logging/error?output
?*
?*??@param[in]??????pRefCon????????????user?supplied?context?pointer
?*??@param[in]????????category????????Log?category?(Error?Warning?Info?etc.)
?*??@param[in]????????pTime????????????pointer?to?NULL-terminated?string?of?time?stamp
?*??@param[in]????????pFile????????????pointer?to?NULL-terminated?string?of?source?module
?*??@param[in]????????LineNumber????????line
?*??@param[in]????????pMsgStr?????????pointer?to?NULL-terminated?string
?*??@retval?????????none
?*/
void?dbgOut?(
????void????????*pRefCon
????TRDP_LOG_T??category
????const?CHAR8?*pTime
????const?CHAR8?*pFile
????UINT16??????LineNumber
????const?CHAR8?*pMsgStr)
{
????const?char?*catStr[]?=?{“**Error:“?“Warning:“?“???Info:“?“??Debug:“};
????printf(“%s?%s?%s:%d?%s“
???????????pTime
???????????catStr[category]
???????????pFile
???????????LineNumber
???????????pMsgStr);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-10-27?09:28??trdp\
?????目錄???????????0??2016-05-20?13:36??trdp\bld\
?????文件?????3233289??2016-10-24?15:06??trdp\BSEN61375-2-3-2015Electronicrailwayequipment.Traincommunicationnetwork(TCN).TCNcommunicati.PDF
?????目錄???????????0??2016-10-25?08:55??trdp\config\
?????文件?????????484??2015-08-03?22:31??trdp\config\buildsettings_posix_TEMPLATE
?????文件?????????772??2015-08-03?22:31??trdp\config\buildsettings_vxworks_TEMPLATE
?????文件?????????814??2015-11-20?22:56??trdp\config\LINUX_config
?????文件????????1437??2015-08-03?22:31??trdp\config\LINUX_PPC_config
?????文件?????????857??2015-08-03?22:31??trdp\config\LINUX_X86_config
?????文件?????????803??2015-12-16?21:10??trdp\config\OSX_X86_config
?????文件?????????704??2015-12-16?21:10??trdp\config\POSIX_X86_config
?????文件?????????717??2015-08-03?22:31??trdp\config\QNX_X86_config
?????文件????????1693??2015-08-03?22:31??trdp\config\VXWORKS_KMODE_PPC_config
?????文件?????????763??2015-12-16?21:10??trdp\config\VXWORKS_PPC_config
?????文件????????1289??2013-05-03?21:23??trdp\Deviation?Request.txt
?????目錄???????????0??2016-10-25?08:55??trdp\doc\
?????目錄???????????0??2016-10-25?08:55??trdp\doc\images\
?????文件?????1802575??2013-06-21?22:59??trdp\doc\images\SingleThreadedWorkflowPD.eps
?????文件??????125461??2013-06-21?22:59??trdp\doc\images\SingleThreadedWorkflowPD.pdf
?????文件???????14343??2012-06-04?19:25??trdp\doc\images\TCNOpen.png
?????目錄???????????0??2016-05-20?13:37??trdp\doc\latex\
?????目錄???????????0??2016-10-25?08:55??trdp\doc\License?Agreements\
?????文件???????19117??2013-08-08?19:39??trdp\doc\License?Agreements\Mozilla?Public?License?version?2.0.htm
?????文件???????39424??2014-08-29?22:09??trdp\doc\memory.xls
?????文件?????1158210??2016-03-10?22:50??trdp\doc\TCN-TRDP2-D-BOM-033-xx?-?TRDP?Reference?Manual.pdf
?????文件???????10683??2016-03-10?01:23??trdp\Doxyfile
?????目錄???????????0??2016-10-25?08:55??trdp\example\
?????文件???????10500??2015-10-17?00:20??trdp\example\echoPolling.c
?????文件???????11467??2015-09-04?21:46??trdp\example\echoSelect.c
?????文件???????14560??2015-09-04?21:46??trdp\example\echoSelectcmdline.c
?????文件????????4689??2015-08-05?19:05??trdp\example\example.xm
............此處省略649個文件信息
評論
共有 條評論