📄 af_can.h.svn-base
字号:
//****************************************************************************//// File: af_can.h //// Description: //// Author: Uwe Koppe //// e-mail: koppe@microcontrol.net //// ////============================================================================//// This program is free software; you can redistribute it and/or modify //// it under the terms of the GNU Lesser General Public License as published //// by the Free Software Foundation; either version 2.1 of the License, or //// (at your option) any later version. ////============================================================================//// //// Date History //// ---------- -------------------------------------------------------------- //// 05.07.2004 Initial version //// ////****************************************************************************//#ifndef _AF_CAN_H_#define _AF_CAN_H_//------------------------------------------------------------------------------// CVS version information:// $Id: af_can.h,v 1.2 2005/07/01 14:03:46 microcontrol Exp $//------------------------------------------------------------------------------/*----------------------------------------------------------------------------*\** Include files **** **\*----------------------------------------------------------------------------*/#include <linux/net.h> // struct socket, net_proto_family#include <linux/socket.h>#include <linux/sockios.h>#include <linux/types.h>#include "canpie.h"//-----------------------------------------------------------------------------/*! \file af_can.h*****//*----------------------------------------------------------------------------*\** Definitions **** **\*----------------------------------------------------------------------------*/#ifndef AF_CAN#define AF_CAN 28 // address family#endifenum CAN_PROTO { CAN_PROTO_RAW = 0, CAN_PROTO_COM, // CANopen master CAN_PROTO_MAX};enum SIOC_CAN { SIOC_CAN_FIRST = SIOCPROTOPRIVATE, SIOC_CAN_SET_BITRATE = SIOC_CAN_FIRST, SIOC_CAN_GET_BITRATE, SIOC_CAN_SET_MODE, SIOC_CAN_GET_STATE, SIOC_CAN_GET_CHANNEL_MAX, SIOC_CAN_SET_FIFOSIZE, SIOC_CAN_LAST = SIOC_CAN_SET_FIFOSIZE};/*----------------------------------------------------------------------------*\** Structures **** **\*----------------------------------------------------------------------------*///---// this structure should be moved into <linux/can.h>/*----------------------------------------------------------------------------*//*!** \struct can_sock af_can.h** \brief Protocol dependent socket structure**** The can_sock structure provides the protocol dependent information** for the CAN socket. */struct can_sock { /*! ** Backlink to the socket structure */ struct sock * ptsSock; /*! ** Link to the CAN port */ _TsCpPort * ptsCanPort; /*! ** CAN identifier of this socket, ** setting CAN_FLAG_ALL .... */ uint32_t can_id; /*! ** size of the receive FIFO in number of messages (NOT bytes) */ uint32_t rcv_fifo_size; /*! ** size of the transmit FIFO in number of messages (NOT bytes) */ uint32_t trm_fifo_size; };struct sockaddr_can { /*! ** address family (AF_CAN) */ sa_family_t can_family; /*! ** logical CAN interface number, compliant to CANpie ** first CAN interface number starts at 0 */ uint16_t can_if; /* CAN_PROTO_RAW-specific */ int32_t can_id;};// #define can_sk(__sk) ((struct can_sock *) __sk)/*----------------------------------------------------------------------------*\** Function prototypes **** **\*----------------------------------------------------------------------------*/int can_socket_init(void);void can_socket_cleanup(void);#endif /* _AF_CAN_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -