本文主要是介绍SOMEIP学习总结,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
SOMEIP学习总结(包含VSOMEIP库)
一.基本概念
1.SOMEIP支持TCP和UDP两种传输方式
其中,SOMEIP-SD的消息都是通过UDP发送的
2.SOMEIP支持如下中间件特性:
-
Serialization – transforming into and from on-wire representation.
-
Remote Procedure Call (RPC) and Messaging – implementing remote invocation of functions as well as other messages.
-
Service Discovery (SD) – dynamically finding and functionality and configuring its access.
-
Publish/Subscribe (Pub/Sub) – dynamically configuring which data is needed and shall be sent to the client.
-
Segmentation of UDP messages – allowing the transport of large SOME/IP messages over UDP without the need of fragmentation.
3.Remote Procedure Call (RPC) and Messaging支持下列消息
- Request/Response Methods: A request sent from a client to the server and a response sent back from server to client. Additionally, SOME/IP allows error responses to be sent back from server to client instead of the regular response. This feature might be used to implement a different payload format in error cases.
- Fire and Forget Methods: A request is sent from a client to the server.
- Event: An event is sent from the server to a relevant clients. Which client needs this event will be determined via SOME/IP-SD.
- Field: A field can have an option notifier (event to be sent cyclically or on-change), an optional setter (a request/response method to update the field), and an optional getter (a request/response method to read out the current value of the field.)
4.服务和事件组的关系
5.Magic Cookie的作用
当SOMEIP在TCP传输写一下,当发生流错误时,可以通过magic cookie找到流中下一条报文的开头位置
6.SOMEIP-SD消息的结构
7.Entry携带Option的内容
8.停止OfferService的方式
Offer和StopOffer的SD报文中,service entry的type都是1(offer),唯一不同的是TTL,在停止service的offer时,发布的SD报文中,service entry的ttl值为0
9.SOMEIP普通消息的结构
10.消息头中的Message Type字段的含义
可以看到,Message Type字段(一个字节)的第七个BIT位是TP FLAG,当使用UDP传输并且payload超过1400字节时,会启用TP传输,此时,Message Type字段的TP FLAG会变成1
https://www.some-ip.com/details.shtml
https://blog.csdn.net/Aliven888/article/details/123333466
这篇关于SOMEIP学习总结的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!