Citation:
Envoyé par louisbmx11
|
un grand merci a louisbmx11 pour le site une library trop riche en quatre langage Pascal/C#/C++/Visual Basic pour le CAN et LIN ,je me commence maintenant d'écris mon premier code pour le Bus LIN par des copier/coller de code source de library a mon premier projet
Code:
// TLINVersion
// Defines a version information.
typedef struct
{
short Major; // Major part of a version number.
short Minor; // Minor part of a version number.
short Revision; // Revision part of a version number.
short Build; // Build part of a version number.
}TLINVersion;
// TLINMsg
// Defines a LIN Message to be sent.
typedef struct
{
BYTE FrameId; // Frame ID (6 bit) + Parity (2 bit).
BYTE Length; // Frame length (1..8).
TLINDirection Direction; // Frame Direction.
TLINChecksumType ChecksumType; // Frame Checksum type.
BYTE Data[8]; // Data bytes (0..7).
BYTE Checksum; // Frame Checksum.
}TLINMsg;
// TLINRcvMsg
// Defines a received LIN message
typedef struct
{
TLINMsgType Type; // Frame type.
BYTE FrameId; // Frame ID (6 bit) + Parity (2 bit).
BYTE Length; // Frame length (1..8).
TLINDirection Direction; // Frame Direction.
TLINChecksumType ChecksumType; // Frame Checksum type
BYTE Data[8]; // Data bytes (0..7).
BYTE Checksum; // Frame Checksum.
TLINMsgErrors ErrorFlags; // Frame error flags.
unsigned __int64 TimeStamp; // Timestamp in microseconds
HLINHW hHw; // Handle of the Hardware which received the message.
}TLINRcvMsg;
// TLINFrameEntry
// Defines a LIN frame entry.
typedef struct
{
BYTE FrameId; // Frame ID (without parity)
BYTE Length; // Frame length (1..8).
TLINDirection Direction; // Frame Direction.
TLINChecksumType ChecksumType; // Frame Checksum type.
WORD Flags; // Frame flags.
BYTE InitialData[8]; // Data bytes (0..7).
}TLINFrameEntry;
des copier/coller des define de mes structur et son commentaires de Bus LIN