📄 j1939tra.h
字号:
/******************************************************************************
*
* File Name: J1939TRA.H
*
* Description: Transport protocolls
*
*
* Comments:
*
*
* Version Date Author Comments
* ------- ----------- -------------- ------------------------------
* 0.9 18.12.98 Ft Create
* 2.0 18.06.2001 Ma new buffer concept and documentation
* for doxygen
*
* Copyright (c) 1998, 1999, 2000, 2001 Vector Informatik GmbH
*****************************************************************************/
#ifndef _J1939TRA_H_
#define _J1939TRA_H_
/*! \brief BAM state machine states and Connection mode data transfer states */
#define CMDT_STATE_CLOSE 0
#define BAM_STATE_CLOSE 0
#define BAM_RX_STATE_DATA 1
#define BAM_TX_STATE_DATA 2
#define BAM_TX_STATE_WAIT 3
#define CMDT_RX_STATE_OPEN 4
#define CMDT_RX_STATE_DATA 5
#define CMDT_TX_STATE_OPEN 6
#define CMDT_TX_STATE_DATA 7
#define TPCM_RTS 16
#define TPCM_CTS 17
#define TPCM_EndOfMsgAck 19
#define TPCM_ABORT 255
#define TPCM_BAM 32
/*! \brief Timebases of the different TP protocols */
#define CMDT_TIMEOUT_4 550 /*!< 550ms timeout after CTS with 0 packets */
#define CMDT_TIMEOUT_3 1250 /*!< 1250ms timeout between data and next CTS */
#define CMDT_TIMEOUT_2 1250 /*!< 1250ms timeout between RTS/CTS and next data */
#define CMDT_TIMEOUT_1 250 /*!< 250ms timeout between two data packets */
#define BAM_RX_TIMEOUT 250 /*!< 250ms BAM timeout */
#define BAM_TX_TIMEOUT 50 /*!< 50ms BAM timeout between two messges */
/*! \brief Definition of the Transport control structure */
struct VJ1939Transport
{
unsigned char mState; /*!< BAM_STATE_CLOSE, BAM_RX_STATE_DATA */
unsigned char mSource; /*!< source/dest. address */
unsigned short mTimer; /*!< timer for timeout */
unsigned short mBytes; /*!< total number of bytes */
unsigned char mSequence; /*!< actual sequence number */
unsigned char mPackets; /*!< total number of packets */
unsigned char mPToSend; /*!< packets to send/receive between CTS */
unsigned char mRxPGTable; /*!< PG receive table */
};
#endif /* _J1939TRA_H_ */
/*! \file
\brief Module header file for the Tranport protocol handling
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -