代码下载,大家请参考 ,以下则直接说明每个文件,每个函数,作用,共同记录学习GitHub - COVESA/vsomeip: An implementation of Scalable service-Oriented MiddlewarE over IP
1someip基础知识
关于SOME/IP的理解_AgingMoon的博客-CSDN博客_someip
2.vsomeip 安装使用
[someip专题]vsomeip使用以及代码解析1_AgingMoon的博客-CSDN博客
3.hello world代码解析
[someip专题]vsomeip代码解析2_AgingMoon的博客-CSDN博客
4. application 解析
4.1 vsomeip application主要功能
主要功能包括
功能 | 说明 |
offer service | 提供服务 |
stop offer service | 停止提供服务 |
publish eventgroup | 发布事件组 |
stop publish eventgroup | 停止发布事件组 |
send request | 发送请求 |
send response | 发送响应 |
trigger event | 事件驱动 |
update field | 更新域 |
receive message | 接收消息 |
subscribe eventgroup | 订阅事件组 |
unsubscribe eventgroup | 取消订阅事件组 |
request service | 请求服务 |
release service | 释放服务 |
4.2 vsomeip application 静态结构
以下针对application中,涉及到的函数进行说明
4.3 vsomeip runtime class
runtime class 接口声明在 interface/vsomeip/runtime.hpp 文件中
runtime 主要包含,vsomeip公共资源的管理,是一个单例类,是application类,创建实例化的入口,前面我们也提到 用runtime 去创建application。
/**
*
* \brief 创建vsomeip application 对象.
*
*应用对象用于管理服务提供,和请求,以及事件订阅,应用对象的名称通过配置文件唯一识别,
*如果名字为空,则会从环境变量VSOMEIP_APPLICATION_NAME中获取
*
* \param _name Name of the application
*
*/
virtual std::shared_ptr<application> create_application(
const std::string &_name = "") = 0;
/**
*
* \brief 构建一个空的 message 对象.
*
* \param _reliable 可靠性由TCP连接还是UDP连接决定
*
*/
virtual std::shared_ptr<message> create_message(
bool _reliable = false) const = 0;
/**
*
* \brief 构建空的 request message.
*
*消息内容和服务实例,有用户设定
*
*/
virtual std::shared_ptr<message> create_request(
bool _reliable = false) const = 0;
/*
* \brief 从给定的请求消息 构建 empty response message
*
*/
virtual std::shared_ptr<message> create_response(
const std::shared_ptr<message> &_request) const = 0;
/**
*
* \brief 创建空的 notification message.
*
* Note: Creating notification messages and sending them using
* @ref application::send is possible but not the standard way of sending
* notification with vsomeip. The standard way is calling
* @ref application::offer_event and setting the value using the
* @ref application::notify / @ref application::notify_one methods.
*
*/
virtual std::shared_ptr<message> c