vsomeip3 双机通信文件配置

验证环境

 Linux 5.4  + Android 11 + vsomeip 3.1.20.3

 vsomeip地址

https://github.com/COVESA/vsomeipicon-default.png?t=M5H6https://github.com/COVESA/vsomeip

Android运行命令,红色的地方需要和配置文件一样

VSOMEIP_CONFIGURATION=./vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./request-sample

Linux运行命令,红色的地方需要和配置文件一样

VSOMEIP_CONFIGURATION=../etc/vsomeip/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./response-sample

Linux service配置文件 ,红色的地方需要更改

# cat ../etc/vsomeip/vsomeip-local.json
{
    "unicast" : "192.168.1.1",
    "logging" :
    {
        "level" : "debug",
        "console" : "true",
        "file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" },
        "dlt" : "false"
    },
    "applications" :
    [
        {
            "name" : "service-sample",
            "id" : "0x1277"
        },
        {
            "name" : "client-sample",
            "id" : "0x1344"
        }
    ],
    "services" :
    [
        {
            "service" : "0x1234",
            "instance" : "0x5678",
            "unreliable" : "30509",
            "multicast" :
            {
                "address" : "224.225.226.233",
                "port" : "32344"
            },
            "events" :
            [
                {
                    "event" : "0x0777",
                    "is_field" : "true",
                    "update-cycle" : 2000
                },
                {
                    "event" : "0x0778",
                    "is_field" : "true",
                    "update-cycle" : 0
                },
                {
                    "event" : "0x0779",
                    "is_field" : "true"
                }
            ],
            "eventgroups" :
            [
                {
                    "eventgroup" : "0x4455",
                    "events" : [ "0x777", "0x778" ]
                },
                {
                    "eventgroup" : "0x4465",
                    "events" : [ "0x778", "0x779" ],
                    "is_multicast" : "true"
                },
                {
                    "eventgroup" : "0x4555",
                    "events" : [ "0x777", "0x779" ]
                }
            ]
        }
    ],
    "routing" : "service-sample",
    "service-discovery" :
    {
        "enable" : "true",
        "multicast" : "192.168.1.255",
        "port" : "30490",
        "protocol" : "udp",
        "initial_delay_min" : "10",
        "initial_delay_max" : "100",
        "repetitions_base_delay" : "200",
        "repetitions_max" : "3",
        "ttl" : "3",
        "cyclic_offer_delay" : "2000",
        "request_response_delay" : "1500"
    }
}

Android client配置文件,红色的地方需要更改,蓝色的地方可不要

  cat vsomeip-local.json
{
    "unicast" : "192.168.1.3",
    "logging" :
    {
        "level" : "debug",
        "console" : "true",
        "file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" },
        "dlt" : "false"
    },
    "applications" :
    [
        {
            "name" : "service-sample",
            "id" : "0x1277"
        },
        {
            "name" : "client-sample",
            "id" : "0x1344"
        }
    ],
    "services" :
    [
        {
            "service" : "0x1234",
            "instance" : "0x5678",
            "unreliable" : "30509",
            "multicast" :
            {
                "address" : "224.225.226.233",
                "port" : "32344"
            },
            "events" :
            [
                {
                    "event" : "0x0777",
                    "is_field" : "true",
                    "update-cycle" : 2000
                },
                {
                    "event" : "0x0778",
                    "is_field" : "true",
                    "update-cycle" : 0
                },
                {
                    "event" : "0x0779",
                    "is_field" : "true"
                }
            ],
            "eventgroups" :
            [
                {
                    "eventgroup" : "0x4455",
                    "events" : [ "0x777", "0x778" ]
                },
                {
                    "eventgroup" : "0x4465",
                    "events" : [ "0x778", "0x779" ],
                    "is_multicast" : "true"
                },
                {
                    "eventgroup" : "0x4555",
                    "events" : [ "0x777", "0x779" ]
                }
            ]
        }
    ],

    "routing" : "client-sample",
    "service-discovery" :
    {
        "enable" : "true",
        "multicast" : "192.168.1.255",
        "port" : "30490",
        "protocol" : "udp",
        "initial_delay_min" : "10",
        "initial_delay_max" : "100",
        "repetitions_base_delay" : "200",
        "repetitions_max" : "3",
        "ttl" : "3",
        "cyclic_offer_delay" : "2000",
        "request_response_delay" : "1500"
    }
}

 

<完> 

  • 21
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 23
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值