CAN通讯中的ISO模型

未完 ,期待。。。。。

7:应用层ISO14229-1:UDS 诊断

typedef struct{
	MType Mtype; //诊断,远程诊断
	uint8_t N_SA; //源地址,
	uint8_t N_TA; //目标地址
	N_TAtype N_TAtype; //物理地址,功能地址
	uint8_t N_AE;
}AddressFormat;

3:网络层ISO 15756-2:提供数据传输的方法。 分别是单帧(SF)、首帧(FF)、序列帧(CF)、流控帧(FC)

This part of ISO 15765 specifies an unconfirmed network layer communication protocol for the exchange of
data between network nodes, e.g. from ECU to ECU, or between external test equipment and an ECU. If the
data to be transferred do not fit into a single CAN frame, a segmentation method is provided.
In order to describe the functioning of the network layer, it is necessary to consider services provided to higher
layers
and the internal operation of the network layer.

ISO15765描述未确认网络层通讯协议,用于网络节点间的数据交换。

如一个ECU到另一个ECU,外部诊断设备和一个ECU。如果要传输的数据适合单个CAN帧,则提供拆包方式。

为了描述网络层功能,就必须考虑提供给更高层服务网络层内部操作

6.2 Services provided by network layer to higher layers

i.e. transmission/reception of data and setting of protocol parameters

a) Communication services 通讯服务

  1. N_USData.request : 网络层提供给链路层请求发送数据
  2. N_USData_FF.indication :该服务用来通知上层,网络层收到了首帧
  3. N_USData.indication:该服务把接收到的完整消息传递给上层
  4. N_USData.confirm :该服务应答给上层,请求服务已经完成,并返回成功与否(回读)

b) Protocol parameter setting services

  1. N_ChangeParameter.request :对内部参数的动态设置请求
  2. N_ChangeParameter.confirm : 确认应答给上层,修改协议已经执行。

6.3 Internal operation of network layer

  1. void NetworkLayer_SendSF(uint8_t length, uint8_t *data)//发送单帧
  2. void NetworkLayer_SendFF(uint16_t length, uint8_t *data)//发送 首帧
  3. void NetworkLayer_SendCF(void) //发送续帧
  4. void NetworkLayer_SendFC(void)//发送流控帧
  5. void NetworkLayer_RxSF(NetworkFrame RxFrame) //收到单帧
  6. void NetworkLayer_RxFF(NetworkFrame RxFrame) //收到首帧
  7. void NetworkLayer_RxCF(NetworkFrame RxFrame)//收到续帧
  8. void NetworkLayer_RxFC(NetworkFrame RxFrame)//收到流控制

内容较多,以后更新。。。。

2:数据链路层 ISO11898:将数据组装成帧(framing)。即将物理层收到的信号(位序列)组成有意义的数据,提供传输错误控制等数据传输控制流程。

数据链路层的三个作用:
1,把比特流组合成帧,然后发出去
2,判断从那一帧开始到那一帧结束
3,通过一些方法(如效验码)来保证数据的正确性
 

数据链路层逻辑链路控制层
LLC
接收过滤
Acceptance filtering
点到点连接,广播,组播
过载通知
Overload notification
接收准备尚未完成
恢复管理
Recovery management
再次发送,bus-off
媒体访问控制层
MAC
数据打包
Data encapsulation
添加SOF,SRR,IDE,RTR,DLC,CRC,ACK和EOF
数据拆包
Data de-capsulation
帧编码(填充,去填充)Frame coding(bit-stuffing ,de-stuffing)填充位插入
媒介管理
Medium access managrment
仲裁和仲裁失败下变为监听模式
错误检测
Error detection
错位通知
Error signalling
CRC错误、填充位错误、位错
误、ACK错误、格式错误
应答方式
Acknowlegement
ACK/NACK

串行Serialisation
半双工通讯
并行De-serialisation
MA_Data.Indication (
    Identifier //标识符ID
    Format //格式
    DLC   // 长度
    Data  // 数据
)
typedef struct{
	uint32_t u32Id;
	uint8_t  u8Ide;
	uint8_t  u8Rtr;
	uint8_t  u8Dlc;
	uint8_t  DataBuff[8];
}Can_Frame_t;



1:物理层 : 通讯速率,数据传输, 高速CAN 低速容错CAN  


  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CAN总线在ISO-11898 的全集 ISO 11898-1:2003 specifies the data link layer (DLL) and physical signalling of the controller area network (CAN). This document describes the general architecture of CAN in terms of hierarchical layers according to the ISO reference model for open systems interconnection (OSI) established in ISO/IEC 7498-1 and provides the characteristics for setting up an interchange of digital information between modules implementing the CAN DLL with detailed specification of the logical link control (LLC) sublayer and medium access control (MAC) sublayer. ISO 11898-2:2003 specifies the high-speed (transmission rates of up to 1 Mbit/s) medium access unit (MAU), and some medium dependent interface (MDI) features (according to ISO 8802-3), which comprise the physical layer of the controller area network. ISO 11898-3:2006 specifies characteristics of setting up an interchange of digital information between electronic control units of road vehicles equipped with the CAN at transmission rates above 40 kBit/s up to 125 kBit/s. ISO 11898-4:2004 specifies time-triggered communication in the CAN. It is applicable to setting up a time-triggered interchange of digital information between electronic control units (ECU) of road vehicles equipped with CAN, and specifies the frame synchronisation entity that coordinates the operation of both logical link and media access controls in accordance with ISO 11898-1, to provide the time-triggered communication schedule. ISO 11898-5:2007 specifies the CAN physical layer for transmission rates up to 1 Mbit/s for use within road vehicles. It describes the medium access unit functions as well as some medium dependent interface features according to ISO 8802-2. This represents an extension of ISO 11898-2, dealing with new functionality for systems requiring low-power consumption features while there is no active bus communication.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值