AUTOSAR-COMStack-003_SignalGroup如何发送&接收

1. Ref

Ref.1 AUTOSAR_RS_Main.pdf

Ref.1 AUTOSAR_RS_Features.pdf

Ref.2 AUTOSAR_SRS_COM.pdf

Ref.3 AUTOSAR_SWS_COM.pdf


2. 为什么要使用Signal Group?

2.1 Traceabilty

请添加图片描述

[RS_PO_00004] AUTOSAR shall define an open architecture for automotive software. (Ref.1)

[RS_Main_00430] AUTOSAR shall support established automotive communication standards (Ref.2)

[RS_BRF_01632] AUTOSAR communication shall support data consistency of groups of signals (Ref.3)

[SRS_Com_02041] The AUTOSAR module shall handle complex data types as a consistent set of data (Ref.4)

[SWS_Com_00050] If Com_SendSignalGroup is called for the signal group, the AUTOSAR COM module shall copy the shadow buffer atomically to the I-PDU buffer.

[SWS_Com_00051] If Com_ReceiveSignalGroup is called for a signal group, the AUTOSAR COM module shall copy the data atomically from the I-PDU buffer to the shadow buffer.

2.2 分析

为什么要使用Signal Group呢?

我们从需求追溯关系入手,按图索骥,搞明白Signal Group相关需求的上游需求来源。

从需求[SRS_Com_02041], [RS_BRF_01632]来看,Signal Group机制主要用于发送,接收复杂数据类型的信号,并保持其一致性。换言之,若一个应用数据比较富足,有多个子数据类型组成,如结构体,若仍旧使用Signal机制,就需要分开进行发送,很难保证一个信号中的子数据类型的一致性。故而绑定各个子数据类型,一起更新,从而保证一致性。

2.3 如何使用 SignalGroup?

假设信号signal_a, signal_b 属于Signal Group group_x, 那么如何发送和接收信号呢?示例如下:

  • 如何发送Signal Group
* copy a to shadow buffer */  
Com_SendSignal (signal_a, &a); 
 
 /* copy b to shadow buffer */  
Com_SendSignal (signal_b, &b);  
 
/* copy shadow buffer to I-PDU */  
Com_SendSignalGroup (group_x); 
  • 如何接收Signal Group
/* copy I-PDU to shadow buffer */  
Com_ReceiveSignalGroup (group_x);  
 
/* copy a from shadow buffer */  
Com_ReceiveSignal (signal_a, &a);  
 
/* copy b from shadow buffer */  
Com_ReceiveSignal (signal_b, &b); 
  • 17
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值