バックナンバーはこちら。
https://www.simulationroom999.com/blog/diagnostic-communication-backnumber/
はじめに
ISO-TPのシミュレーションをしよう。のシリーズ。
CanTpを取り巻く構造などを頑張って絵に描いてみる。
登場人物
博識フクロウのフクさん
![](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん
![](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/技術者01アップ.png)
イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
AUTOSAR CanTpのインターフェース復習
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
前回のAUTOSAR CanTpのインターフェースは以下だったね。
- CanTp_Transmit。
- CanTp_MainFunction。
- CanTp_RxIndication。
- CanTp_TxConfirmation。
- CanIf_Transmit。
- PduR_CanTpCopyRxData。
- PduR_CanTpCopyTxData。
- PduR_CanTpRxIndication。
- PduR_CanTpStartOfReception。
- PduR_CanTpTxConfirmation。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/「技術者a」10アップ.png)
うん。それは覚えてるけど、イマイチ関係性が・・・。
接頭語が関係性を示してるんだっけ?
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
うん。
これも前回言ったけど、こんなイメージ
CanTp_:CanTpへの通知
CanIf_:CanTpからCanIfへの通知
PduR_:CanTpから上位層への通知
AUTOSAR CanTpのインターフェースを絵で表現してみた
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/技術者02アップ.png)
で、頑張って絵で表現してみるって言ってけど、進捗は如何に?
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/考え中フクロウ.png)
(なんで偉そうなんだ?)
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
一応書いてきたよ。
こんなイメージだね。
![AUTOSAR-CanTp構造概要。インタラクション層、CanTp、データリンク層](https://www.simulationroom999.com/blog/wp-content/uploads/2020/08/02_CanTp構造-1024x639.png)
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/技術者03アップ.png)
おー。なるほど。
インタラクション層ってのとデータリンク層でサンドイッチになっていたのか。
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
というわけで、
CanTpとCanIfことXLドライバライブラリの繋ぎ
と、
CanTpとインタラクション層の繋ぎ
の辻褄を合わせれば動作するはず。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/「技術者a」13アップ.png)
インターフェース用のソースファイルを用意する感じかな?
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/お休みフクロウ.png)
それでも良いし、PduR_CanTp.hにPduR宛てのインターフェース関数がインライン関数として記載されているんで、これの中を埋めるでも良いねー。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/技術者02アップ.png)
すでにあるなら、そっちを使おうか。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/「技術者a」13アップ.png)
CanIfの方は?
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
同じようにCanIf.hにインライン関数として記載されている。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/技術者01アップ.png)
お、ということは、CanTpはCanTp.h?
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
CanTp向けの関数の実態はCanTp.cにあって、
外部からの呼出し用のextern宣言はCanTp_Cbk.hでされてるね。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/技術者03アップ.png)
あ、そっか。
CanTp自体は実装されている物を持ってきてるから
こっちで実装する必要は無いのか。
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
とりあえず、各種インターフェースの繋ぎは追々やっていくとして、
あとはコンフィグレーション定義だねー。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/「技術者a」13アップ.png)
なにそれ?
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/お休みフクロウ.png)
車両診断通信を実現するチャンネルの定義だね。
これはこれで結構なボリュームになるんで、次回説明かな。
![太郎くん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/「技術者a」10アップ.png)
(なにそれこわい)
まとめ
![フクさん](https://www.simulationroom999.com/blog/wp-content/uploads/2020/05/指差しフクロウ.png)
まとめだよ。
- AUTOSAR CanTpのインターフェースの復習。
- AUTOSAR CanTpのインターフェースを図解してみた。
- 各種インターフェースはそれぞれのヘッダファイルで定義はされている。
- シミュレーション用に辻褄合わせは必要。
バックナンバーはこちら。
コメント