Giter Site home page Giter Site logo

capicxx-someip-tools's Introduction

CommonAPI C++ SOME/IP Tools

Copyright

Copyright (C) 2015-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG). Copyright (C) 2015-2023, COVESA

This file is part of COVESA Project IPC Common API C++. Contributions are licensed to the COVESA under one or more Contribution License Agreements or MPL 2.0.

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/.

CommonAPI C++ Specification and User Guide

The specification document and the user guide can be found in the CommonAPI documentation directory of the CommonAPI-Tools project.

Further information

https://covesa.github.io/capicxx-core-tools/

Build Instructions for Linux

You can build all code generators by calling maven from the command-line. Open a console and change in the directory org.genivi.commonapi.someip.releng of your CommonAPI-Tools directory. Then call:

mvn -DCOREPATH=<path to your CommonAPI-Tools dir> -Dtarget.id=org.genivi.commonapi.someip.target clean verify

COREPATH is the directory, that contains the target definition folder: org.genivi.commonapi.someip.target.

After the successful build you will find the commond-line generators archived in org.genivi.commonapi.someip.cli.product/target/products/commonapi_someip_generator.zip and the update-sites in org.genivi.commonapi.someip.updatesite/target.

capicxx-someip-tools's People

Contributors

andreias23 avatar dhuss avatar dibpinto avatar goncaloalmeida avatar juergengehring avatar love1angel avatar lutzbichler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

capicxx-someip-tools's Issues

Typo in HelloWorld.depl from tutorial "CommonAPI C++ SOME/IP in 10 minutes"

In the tutorial "CommonAPI C++ SOME/IP in 10 minutes", the example deployment file (HelloWorld.depl) has a typo (or maybe it is not up to date).
There is a missing "as". I think it should be:

define org.genivi.commonapi.someip.deployment for provider as MyService {

instead of:

define org.genivi.commonapi.someip.deployment for provider MyService {

I had an issue with 3.2.0.1 of the generator and adding the "as" solve the issue.
What do you think?

HelloWorld running issue

Hi,

I've built the HelloWorld(described in the wiki), for vsomeip3. After a small change in CMakeLists(for linking with vsomeip3 and some generated cpp file name), I managed to have two binaries(HelloWorldClient and HelloWorldService).

I've configured the /etc/commonapi.ini to something like:
[default]
binding=someip

[logging]
console = true
file = ./mylog.log
dlt = false
level = verbose

Now, I have this output, that shows missing the test library and configuration module:
@catalin-virt:/sources/genivi/project/build$ [CAPI][INFO] Loading configuration file '/etc/commonapi.ini'
[CAPI][INFO] Using default binding 'someip'
[CAPI][INFO] Using default shared library folder '/usr/local/lib/commonapi'
[CAPI][DEBUG] Added address mapping: local:commonapi.HelloWorld:v1_0:test <--> [1234.5678(1.0)]
[CAPI][INFO] Registering function for creating "commonapi.HelloWorld:v1_0" stub adapter.
[CAPI][DEBUG] Loading library for local:commonapi.HelloWorld:v1_0:test stub.
[CAPI][DEBUG] Loading interface library "liblocal__commonapi_HelloWorld:v1_0__test.so" failed (liblocal__commonapi_HelloWorld:v1_0__test.so: cannot open shared object file: No such file or directory)
[CAPI][INFO] Registering stub for "local:commonapi.HelloWorld:v1_0:test"
Configuration module could not be loaded!

What should I do now to make the sample to communicate between client and service ?

Thank you !

Adding error section to existing method inserts error byte into first byte of reply body rather than last byte of SOME/IP header

I have a method defined in .fidl that works OK, taking a UInt32 input parameter and returning a 4 byte data structure, e.g.

SOME/IP Protocol (Service ID: 0x433f, Method ID: 0x0103, Length: 12)
    Service ID: 0x433f
    Method ID: 0x0103
    Length: 12
    Client ID: 0x0000
    Session ID: 0x0001
    SOME/IP Version: 0x01
    Interface Version: 0x01
    Message Type: 0x80 (Response)
    Return Code: 0x00 (Ok)
    Payload: 00000000

I now want to do extend my code to do some validity checking on the input parameter and insert a non-zero return code into the SOME/IP reply header if the checking fails.

I have naiively added an error clause to my .fidl and updated my implementation to fill in the error code, but all that seems to do is to insert my error code byte into the start of the data, i.e. returning 5 bytes of user data instead of 4 bytes.

SOME/IP Protocol (Service ID: 0x433f, Method ID: 0x0103, Length: 13)
    Service ID: 0x433f
    Method ID: 0x0103
    Length: 13        <--- Was 12
    Client ID: 0x0000
    Session ID: 0x0001
    SOME/IP Version: 0x01
    Interface Version: 0x01
    Message Type: 0x80 (Response)
    Return Code: 0x00 (Ok)   <--- Not what I want
    Payload: 3000000000

Note the change to the Length field and the extra "30" byte at the start of the data.

Here is my method specification with the new error section:

package commonapi.examples

interface Test {

  version {major 1 minor 0}

  enumeration eErrorCode {
    E_NO_ERROR=0x00                     /* No error */
    E_INVALID_INDEX=0x30                /* The requested index is out of range. */
  }

  struct sData {
    UInt32          Data1
  }

  method getData {
    in {
        UInt32 dataIndex
    }
    out {
        sData data
    }
    error eErrorCode
  }
}

My stub implementation is as follows:

#include "TestStubImpl.hpp"
#include <v1/commonapi/examples/Test.hpp>

using namespace v1::commonapi::examples;

TestStubImpl::TestStubImpl()
{
}

TestStubImpl::~TestStubImpl()
{
}

void TestStubImpl::getData(const std::shared_ptr<CommonAPI::ClientId> _client,
                                                uint32_t _dataIndex,
                                                getDataReply_t _reply)
{
    (void)_client;
    Test::eErrorCode error = Test::eErrorCode::E_INVALID_INDEX;
    Test::sData data = {};

    if (_dataIndex == 0UL)
    {
        error = Test::eErrorCode::E_NO_ERROR;
    }
    _reply(error, data);
}

In CommonAPI-SOMEIP_deployment_spec.fdepl I can see that SomeIpErrorCoding defaults to 'Header', but there does not appear to be another option - I don't know if that is relevant to this issue.

It looks to me like either I am missing a call into the SOME/IP stack to tell it that there has been an error, or alternatively that I am missing some configuration that tells the SOME/IP stack that the stub implementation of this method is providing the return code.

[Edited to display complete .fidl file, to show trace outputs straight from WireShark and to include stub implementation.]

Any ideas?

Failed to generate from HelloWorld.fdepl by commonapi_someip_generator-3.2.0.1

Downloaded binary from https://github.com/GENIVI/capicxx-someip-tools/releases

The HelloWorld.fidl and HelloWorld.fdepl are original from "https://github.com/GENIVI/capicxx-someip-tools/wiki/CommonAPI-C---SomeIP-in-10-minutes"

Exeucute command as:

commonapi-someip-generator-linux-x86_64 ./HelloWorld.fdepl

Got the following Error:

Executing CommonAPI SomeIP Code Generation...                                                                                                               
                                                                                                                                                            
Using Franca Version 0.13.1.201807231814                                                                                                                    
Error: SomeIP validation: Couldn't resolve reference to EObject 'MyService'. (file:/home/eric/Data-1/CommonAPI/idl/./HelloWorld.fdepl line : 12 column : 60)
Error: SomeIP validation: Root 'provider' must have a name (file:/home/eric/Data-1/CommonAPI/idl/./HelloWorld.fdepl line : 12 column : 51)                  
/home/eric/Data-1/CommonAPI/idl/./HelloWorld.fdepl contains validation errors !              

Is there anything wrong?

THX~

Problem describing ISO 17215 (VCIC) sPersistentStorageEntry in Franca IDL deployment file

I am trying to describe the sPersistentStorageEntry data structure from ISO 17215 in Franca IDL:

Name Type Comment
Flag UInt32 -
Length UInt16 Length of persistent data in bytes
PersistentStorageID UInt16 -
PersistentData UInt8[Length] -
CRC16 UInt16 -

The problem I am having is in specifying the length of PersistentData so that the on-the-wire representation of the data is in the correct order.

According to https://github.com/COVESA/capicxx-someip-tools/blob/master/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl I can define PersistentData as an array with a SomeIpArrayLengthWidth=2 to specify a length field of 2 bytes, but how do I specify where in the on-the-wire packet the length field comes? - I would assume that this would be placed immediately before the PersistentData, but in the VCIC specification there is an intervening UInt16 PersistentStorageID, so is there anything in the deployment language that will let me meet this requirement?

Resourse not loading if the uri contains space

URI.createFileURI(file) does not decode the the file path with space. Resorce loading throws the file not found exception. Please try to use the below code snippet in all *ToolMain and *Validator.

URI.createFileURI(URI.decode(file));

Warning: SomeIP validation

What does this warning mean? Why should the .fidl file reference the .fdepl file?

Warning: SomeIP validation: Deployment references ".../models/com/nio/hardware/gnss/idl/DataTypes.fidl" without referencing expected deployment file ".../models/com/nio/hardware/gnss/idl/DataTypes.fdepl". (file:.../models/com/nio/hardware/gnss/deploy/DataTypes.fdepl line : 1)

Compile error because of some pure virtual functions

I tried to follow the SomeIP hello world steps using the 3.1 versions of the generators.
The fidl and fdepl files are used for generating src-gen.
Compiling the CMake results give this error:

Scanning dependencies of target HelloWorldService
[ 10%] Building CXX object CMakeFiles/HelloWorldService.dir/src/HelloWorldStubImpl.cpp.o
[ 20%] Building CXX object CMakeFiles/HelloWorldService.dir/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.cpp.o
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++allocator.h:33,
                 from /usr/include/c++/9/bits/allocator.h:46,
                 from /usr/include/c++/9/string:41,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/functional:54,
                 from /home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldStub.hpp:13,
                 from /home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.hpp:13,
                 from /home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.cpp:10:
/usr/include/c++/9/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}; _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>]’:
/usr/include/c++/9/bits/alloc_traits.h:482:2:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}; _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub> >]’
/usr/include/c++/9/bits/shared_ptr_base.h:548:39:   required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}; _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; _Alloc = std::allocator<v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub> >; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/9/bits/shared_ptr_base.h:679:16:   required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; _Alloc = std::allocator<v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub> >; _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/9/bits/shared_ptr_base.h:1344:71:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub> >; _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}; _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/9/bits/shared_ptr.h:359:59:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub> >; _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}; _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>]’
/usr/include/c++/9/bits/shared_ptr.h:701:14:   required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; _Alloc = std::allocator<v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub> >; _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}]’
/usr/include/c++/9/bits/shared_ptr.h:717:39:   required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>; _Args = {const CommonAPI::SomeIP::Address&, const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection>&, const std::shared_ptr<CommonAPI::StubBase>&}]’
/home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.cpp:28:120:   required from here
/usr/include/c++/9/ext/new_allocator.h:145:20: error: invalid new-expression of abstract class type ‘v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>’
  145 |  noexcept(noexcept(::new((void *)__p)
      |                    ^~~~~~~~~~~~~~~~~~
  146 |        _Up(std::forward<_Args>(__args)...)))
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.cpp:10:
/home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.hpp:101:7: note:   because the following virtual functions are pure within ‘v1::commonapi::HelloWorldSomeIPStubAdapter<v1::commonapi::HelloWorldStub>’:
  101 | class HelloWorldSomeIPStubAdapter
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/lib/cmake/CommonAPI-3.2.0/../../../include/CommonAPI-3.2/CommonAPI/SomeIP/StubManager.hpp:16,
                 from /usr/local/lib/cmake/CommonAPI-3.2.0/../../../include/CommonAPI-3.2/CommonAPI/SomeIP/Connection.hpp:23,
                 from /usr/local/lib/cmake/CommonAPI-3.2.0/../../../include/CommonAPI-3.2/CommonAPI/SomeIP/StubAdapterHelper.hpp:23,
                 from /home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.hpp:20,
                 from /home/kai/data/src/commonAPIproject/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.cpp:10:
/usr/local/lib/cmake/CommonAPI-3.2.0/../../../include/CommonAPI-3.2/CommonAPI/SomeIP/StubAdapter.hpp:52:36: note:       ‘virtual void CommonAPI::SomeIP::StubAdapter::registerSelectiveEventHandlers()’
   52 |      COMMONAPI_EXPORT virtual void registerSelectiveEventHandlers() = 0;
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lib/cmake/CommonAPI-3.2.0/../../../include/CommonAPI-3.2/CommonAPI/SomeIP/StubAdapter.hpp:53:36: note:       ‘virtual void CommonAPI::SomeIP::StubAdapter::unregisterSelectiveEventHandlers()’
   53 |      COMMONAPI_EXPORT virtual void unregisterSelectiveEventHandlers() = 0;
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/HelloWorldService.dir/build.make:89: CMakeFiles/HelloWorldService.dir/src-gen/v1/commonapi/HelloWorldSomeIPStubAdapter.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/HelloWorldService.dir/all] Fehler 2
make: *** [Makefile:84: all] Fehler 2

I'm using an Ubuntu system 20.04.2 LTS, compilers have gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) and CMake is version 3.16.3.

I fear the versions are to new to run the examples without changes?

Warning: SomeIP validation: Attribute "var" has no valid 'SomeIpNotifierEventGroups' specified.

When running the code generator, a warning message appears as follows.

The code generates without a problem, but the SomeIPProxy.cpp code gives an error because of the UNDEFINED_EVENTGROUP_ID variable.

How can I solve this?

  • warning log
Default output directory: src-gen-seame/
Using Franca Version 0.13.1.201807231814
Warning: SomeIP validation: Attribute "hum" has no valid 'SomeIpNotifierEventGroups' specified. 
Warning: SomeIP validation: Attribute "tmp" has no valid 'SomeIpNotifierEventGroups' specified. 
Warning: SomeIP validation: Attribute "rpm" has no valid 'SomeIpNotifierEventGroups' specified. 
Warning: SomeIP validation: Attribute "spd" has no valid 'SomeIpNotifierEventGroups' specified. 
Warning: SomeIP validation: Attribute "bat" has no valid 'SomeIpNotifierEventGroups' specified. 
Warning: SomeIP validation: Attribute "ultrasonic" has no valid 'SomeIpNotifierEventGroups' specified. 
SomeIP validation: Validation of deployment finished with: 0 errors, 6 warnings.
Generating code for
  • seame.fidl
package commonapi

interface SEAME {
  version {major 1 minor 0}
  
  attribute UInt8  hum
  attribute Int8   tmp
  attribute UInt16 rpm
  attribute UInt8  spd
  attribute UInt8  bat
  attribute UInt8  ultrasonic
}

  • seame.fdepl
import "seame.fidl"

define org.genivi.commonapi.someip.deployment for interface commonapi.SEAME {
  SomeIpServiceID = 4660

  attribute hum {

    // Every attribute must have at least one of [SomeIpGetterID, SomeIpSetterID, SomeIpNotifierID] specified.

    SomeIpGetterID = 3000

    // If an attribute is declared as 'readonly', it must *not* have a 'SomeIpSetterID' specification.

    SomeIpSetterID = 3001

    // If an attribute is declared as 'noSubscriptions', it must *not* have a 'SomeIpNotifierID' specification.

    SomeIpNotifierID = 33000

    // If an attribute has a 'SomeIpNotifierID' specification, the attribute must also have a valid event group
    // specified within the 'SomeIpNotifierEventGroups' setting.
    SomeIpNotifierEventGroups = { 33000 }

    SomeIpAttributeReliable = true
  }
  attribute tmp {
    SomeIpGetterID = 3002
    SomeIpSetterID = 3003
    SomeIpNotifierID = 33001
    SomeIpNotifierEventGroups = { 33001 }

    SomeIpAttributeReliable = true
  }
  attribute rpm {
    SomeIpGetterID = 3004
    SomeIpSetterID = 3005
    SomeIpNotifierID = 33002
    SomeIpNotifierEventGroups = { 33002 }

    SomeIpAttributeReliable = true
  }
  attribute spd {
    SomeIpGetterID = 3006
    SomeIpSetterID = 3007
    SomeIpNotifierID = 33003
    SomeIpNotifierEventGroups = { 33003 }

    SomeIpAttributeReliable = true
  }
  attribute bat {
    SomeIpGetterID = 3008
    SomeIpSetterID = 3009
    SomeIpNotifierID = 33004
    SomeIpNotifierEventGroups = { 33004 }

    SomeIpAttributeReliable = true
  }
  attribute ultrasonic {
    SomeIpGetterID = 3010
    SomeIpSetterID = 3011
    SomeIpNotifierID = 33005
    SomeIpNotifierEventGroups = { 33005 }

    SomeIpAttributeReliable = true
  }
}

define org.genivi.commonapi.someip.deployment for provider as MoonService {
  instance commonapi.SEAME {
    InstanceId = "seame"
    
    SomeIpInstanceID = 22144
    SomeIpUnicastAddress = "127.0.0.1"
    SomeIpReliableUnicastPort = 31000
  }
}
  • Generated SEAMESomeIPProxy.cpp
SEAMESomeIPProxy::SEAMESomeIPProxy(
    const CommonAPI::SomeIP::Address &_address,
    const std::shared_ptr<CommonAPI::SomeIP::ProxyConnection> &_connection)
        : CommonAPI::SomeIP::Proxy(_address, _connection),
          hum_(*this, UNDEFINED_EVENTGROUP_ID, CommonAPI::SomeIP::event_id_t(0x80e8), CommonAPI::SomeIP::method_id_t(0xbb8), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0xbb9), false, static_cast< CommonAPI::SomeIP::IntegerDeployment<uint8_t>* >(nullptr)),
          tmp_(*this, UNDEFINED_EVENTGROUP_ID, CommonAPI::SomeIP::event_id_t(0x80e9), CommonAPI::SomeIP::method_id_t(0xbba), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0xbbb), false, static_cast< CommonAPI::SomeIP::IntegerDeployment<int8_t>* >(nullptr)),
          rpm_(*this, UNDEFINED_EVENTGROUP_ID, CommonAPI::SomeIP::event_id_t(0x80ea), CommonAPI::SomeIP::method_id_t(0xbbc), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0xbbd), false, static_cast< CommonAPI::SomeIP::IntegerDeployment<uint16_t>* >(nullptr)),
          spd_(*this, UNDEFINED_EVENTGROUP_ID, CommonAPI::SomeIP::event_id_t(0x80eb), CommonAPI::SomeIP::method_id_t(0xbbe), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0xbbf), false, static_cast< CommonAPI::SomeIP::IntegerDeployment<uint8_t>* >(nullptr)),
          bat_(*this, UNDEFINED_EVENTGROUP_ID, CommonAPI::SomeIP::event_id_t(0x80ec), CommonAPI::SomeIP::method_id_t(0xbc0), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0xbc1), false, static_cast< CommonAPI::SomeIP::IntegerDeployment<uint8_t>* >(nullptr)),
          ultrasonic_(*this, UNDEFINED_EVENTGROUP_ID, CommonAPI::SomeIP::event_id_t(0x80ed), CommonAPI::SomeIP::method_id_t(0xbc2), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0xbc3), false, static_cast< CommonAPI::SomeIP::IntegerDeployment<uint8_t>* >(nullptr))
{
}

Compile error related to enumeration definition inside of typeCollection with generator 3.2.0.1

Our fidl file:
package com.conti.uisrv

interface qplayer {
version { major 1 minor 0 }

attribute qplayerTypes.playStatus currentStatus
attribute qplayerTypes.playStatus targetStatus

}

typeCollection qplayerTypes {
version { major 1 minor 0 }

enumeration playStatus {
    UNKNOWN = 0
    READY = 1
    PLAYING = 2
    PAUSED = 3
    FINISHED  = 4
    STOPPED = 5
}

}
##########################################################################################
Our fdepl file:
import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"

import "qplayer.fidl"

define org.genivi.commonapi.someip.deployment for interface com.conti.uisrv.qplayer {

SomeIpServiceID = 4096

attribute currentStatus
{
    SomeIpGetterID = 400
    SomeIpSetterID = 401
    SomeIpNotifierID = 402
    SomeIpEventGroups =
    {   4000}
}

attribute targetStatus
{
    SomeIpGetterID = 403
    SomeIpSetterID = 404
    SomeIpNotifierID = 405
    SomeIpEventGroups =
    {   4000}
}

}

define org.genivi.commonapi.someip.deployment for provider CorePartition
{
instance com.conti.uisrv.qplayer
{
InstanceId = "Display0"
SomeIpInstanceID = 256
}
instance com.conti.uisrv.qplayer
{
InstanceId = "Display1"
SomeIpInstanceID = 257
}
instance com.conti.uisrv.qplayer
{
InstanceId = "Display2"
SomeIpInstanceID = 258
}
instance com.conti.uisrv.qplayer
{
InstanceId = "Display3"
SomeIpInstanceID = 259
}
instance com.conti.uisrv.qplayer
{
InstanceId = "Display4"
SomeIpInstanceID = 260
}
instance com.conti.uisrv.qplayer
{
InstanceId = "Display5"
SomeIpInstanceID = 261
}
}
##########################################################################################
Error:
qplayerSomeIPProxy.cpp:72:307: error: no member named 'playStatusDeployment' in namespace 'v1::com::conti::uisrv::qplayerTypes_

The reason is clear for me: generator (v3.2.0.1) generates the wrong type inside of the constructor:
qplayerSomeIPProxy::qplayerSomeIPProxy(
const CommonAPI::SomeIP::Address &address,
const std::shared_ptrCommonAPI::SomeIP::ProxyConnection &connection)
: CommonAPI::SomeIP::Proxy(address, connection),
currentStatus
(*this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x192), CommonAPI::SomeIP::method_id_t(0x190), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0x191), false, &::v1::com::conti::uisrv::qplayerTypes
::playStatusDeployment),
targetStatus
(*this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x195), CommonAPI::SomeIP::method_id_t(0x193), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_id_t(0x194), false, &::v1::com::conti::uisrv::qplayerTypes
::playStatusDeployment)
{
}
I compared qplayerSomeIPProxy.cpp, generated with generator 3.1.12.1 and the parameters for currentStatus_ generated properly:
qplayerSomeIPProxy::qplayerSomeIPProxy(
const CommonAPI::SomeIP::Address &address,
const std::shared_ptrCommonAPI::SomeIP::ProxyConnection &connection)
: CommonAPI::SomeIP::Proxy(address, connection )
, currentStatus
(*this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x192), CommonAPI::SomeIP::method_id_t(0x190), false, false, CommonAPI::SomeIP::method_id_t(0x191), false, static_cast< ::v1::com::conti::uisrv::qplayerTypes
::playStatusDeployment_t* >(nullptr)),
targetStatus
(*this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x195), CommonAPI::SomeIP::method_id_t(0x193), false, false, CommonAPI::SomeIP::method_id_t(0x194), false, static_cast< ::v1::com::conti::uisrv::qplayerTypes
::playStatusDeployment_t* >(nullptr))
{
}

For verification I shifted qplayerTypes enumeration from typeCollection into interface description and it will solve the problem, but of course requires the changes in source code.

Is the issue already known ?

BUG of structure nesting

fidl:

package commonapi

interface DCusInterfaces {
    version { major 1 minor 0 }
    struct Domain {
        String name
    }
    struct Detail {
        Domain domain
    }
}

fdepl:

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "DCusInterfaces_1.fidl"

define org.genivi.commonapi.someip.deployment for interface commonapi.DCusInterfaces {
    SomeIpServiceID = 15068
    struct Domain {
        SomeIpStructLengthWidth = 4
        name {
            SomeIpStringLengthWidth = 4
            SomeIpStringLength = 16
            SomeIpStringEncoding = utf8
        }
    }
    struct Detail {
        SomeIpStructLengthWidth = 4
    }
}

define org.genivi.commonapi.someip.deployment for provider as Service {
    instance commonapi.DCusInterfaces {
        InstanceId = "commonapi.DCusInterfaces"
        SomeIpInstanceID = 26068
    }
}

When I compile, I get the following error, It looks like an error caused by adding an extra prefix.:

/work1/test/gen/src/v1/commonapi/DCusInterfacesSomeIPDeployment.cpp:19:116: Error:‘Detail_domain_Domain_nameDeployment’ is not a member of ‘v1::commonapi::DCusInterfaces_’; did you mean ‘Detail_domainDeployment’?
   19 | Interfaces_::DomainDeployment_t Detail_domainDeployment(4, &::v1::commonapi::DCusInterfaces_::Detail_domain_Domain_nameDeployment);

When I do not specify SomeIpStringLength, the compilation passes:
fdepl:

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "DCusInterfaces_1.fidl"

define org.genivi.commonapi.someip.deployment for interface commonapi.DCusInterfaces {
    SomeIpServiceID = 15068
    struct Domain {
        SomeIpStructLengthWidth = 4
        name {
            SomeIpStringLengthWidth = 4
            #SomeIpStringLength = 16 //Remove this line
            SomeIpStringEncoding = utf8
        }
    }
    struct Detail {
        SomeIpStructLengthWidth = 4
    }
}

define org.genivi.commonapi.someip.deployment for provider as Service {
    instance commonapi.DCusInterfaces {
        InstanceId = "commonapi.DCusInterfaces"
        SomeIpInstanceID = 26068
    }
}

Thanks

While Running .fdepl files with commonapi-core-generator getting an error

While running .fdepl files with commonapi getting an error message as the one which is mentioned below -

  • Failed to generate code for C:\f-file_structure\crossif13\idl\instances\MGU\de.infotainment.navigation.mapcontrol.fdepl due to null

raise CommonApiGenError("call of '%s' failed: code %s" % (call, ret_code))

main__.CommonApiGenError: call of 'C:\TAF\eclipse_workspace\CommonAPI_3.2\commonapi_core_generator-3.2.12\commonapi-core-generator-windows-x86_64 -sk -d src-gen\core C:\f-file_structure\crossif13\idl\instances\MGU\de.infotainment.navigation.mapcontrol.fdepl' failed: code 1

to use 3.2.14 or master code to generate code, when compile XXXSomeIPStubAdapter.cpp it says compiling error

when use 3.2.14 or master code to generate code, when compile XXXSomeIPStubAdapter.cpp it says compiling error, as below:

/home/v2x/workspace/joynext/jvs-oi/fidl/src-gen/v1/commonapi/v2x/V2XStackServiceSomeIPStubAdapter.cpp:33:106: required from here

*_/usr/include/c++/11/ext/new_allocator.h:162:11: error: no matching function for call to ‘CommonAPI::SomeIP::ClientId::ClientId()’
162 | { ::new((void )__p) _Up(std::forward<Args>(__args)...); }

and compared the FInterfaceSomeIPStubAdapterGenerator.xtend of 3.2.0 with the FInterfaceSomeIPStubAdapterGenerator.xtend of 3.2.14 or master, the code is difference:

line 196 of the FInterfaceSomeIPStubAdapterGenerator.xtend of 3.2.0 is
std::shared_ptr<CommonAPI::SomeIP::ClientId> itsClient = std::make_shared<CommonAPI::SomeIP::ClientId>(0xFFFF, 0xFFFFFFFF, 0xFFFFFFFF);

but line 196 of the FInterfaceSomeIPStubAdapterGenerator.xtend of 3.2.0 and master is
std::shared_ptr<CommonAPI::SomeIP::ClientId> itsClient = std::make_shared<CommonAPI::SomeIP::ClientId>();

So, I think this is an potential issue of the SomeIP generate tool

Compile error related to extended structs with array member

Hello, I'm studying the SOME/IP by following the Wiki but encontered a compile error and I have no idea about how to solve it.

The .fidl file:

typeCollection CommonType {
    version { major 1 minor 0 }
    enumeration ValueType {
        Node            = 0
        LaneModel       = 4
        FormOfWay       = 16
        VersionSoftware = 52
    }
    struct ValueBase polymorphic {
    }
    struct Data {
        ValueType type
        ValueBase value
    }
    struct ValueA extends ValueBase {
         UInt32 id
    }
    struct Item {
        UInt32 size
    }
    struct ValueB extends ValueBase {
         Item [ ] items
    }
}

interface MessageBus {
    version { major 1 minor 0 }
    attribute CommonType.Data data readonly
}

After generating code with commonapi-generator and commonapisomeip_generator, I compiled my test code but failed with:

error: no matching function for call to 'CommonAPI::SomeIP::OutputStream::writeValue(const std::vector<v1::com::CommonType::Item>&, const CommonAPI::EmptyDeployment*&)'

I haven't dive into CommonAPI yet but it seems that the server write ValueBase with an EmptyDeployment, which doesn't work with array. The compile error won't occur if I remove ValueB and keep ValueA. Should I add something to the .fdepl file or replace the value in Data with a byte buffer and serialize the ValueA and ValueB by myself?

commonapi_someip_generator fail

When I follow the steps to some/ip generator,it's crash.
The pop up says:An error has occurred. See the log file
/home/jerry/work/project/cgen/commonapi_someip_generator/configuration/1577348555253.log.
My system is 64bit ubuntu, and java version is 1.8.0_232.
The eclipse have been installed.Please help!
The log as flow:

!SESSION 2019-12-26 16:22:35.125 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_232
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -ll verbose ./fidl/HelloWorld.fdepl
Command-line arguments: -os linux -ws gtk -arch x86_64 -ll verbose ./fidl/HelloWorld.fdepl

!ENTRY org.eclipse.equinox.launcher.win32.win32.x86 2 0 2019-12-26 16:22:35.744
!MESSAGE Could not resolve module: org.eclipse.equinox.launcher.win32.win32.x86 [34]
Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))"

!ENTRY org.eclipse.osgi 4 0 2019-12-26 16:22:35.748
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "org.genivi.commonapi.console.application" could not be found in the registry. The applications available are: org.eclipse.emf.codegen.CodeGen, org.eclipse.emf.codegen.JMerger, org.eclipse.emf.codegen.ecore.Generator, org.eclipse.emf.mwe.core.WorkflowRunner, org.eclipse.equinox.app.error, org.eclipse.jdt.core.JavaCodeFormatter, org.eclipse.jdt.core.JavaIndexer.

undefined method id start from 0 which is reserved

Hello,

Depend on [TR_SOMEIP_00517], the method id 0 is reserved.
But , I find the capi will use some auto-generated method id(start from 0x0) on some undefined methods for attribute, such as a getXXXAttributeStubDispatcher .

For example, a read-only attribute without getter id.

Could you please modify it to start from other value such as 0x7ffe but not the 0?

Cpp Code Generation Failed

i'm trying to generate code but i'm getting the following error

Executing CommonAPI SomeIP Code Generation...

Using Franca Version 0.13.1.201807231814

Error: SomeIP validation: Couldn't resolve reference to EObject 'MyService'. (file:/home/mob/Documents/vsomeip/fidlExamples/./fidl/HelloWorld.fdepl line : 12 column : 60)

Error: SomeIP validation: Root 'provider' must have a name (file:/home/mob/Documents/vsomeip/fidlExamples/./fidl/HelloWorld.fdepl line : 12 column : 51)

/home/mob/Documents/vsomeip/fidlExamples/./fidl/HelloWorld.fdepl contains validation errors !

This is the content of fdpel file

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"

import "HelloWorld.fidl"



define org.genivi.commonapi.someip.deployment for interface commonapi.HelloWorld {

	SomeIpServiceID = 4660



	method sayHello {

		SomeIpMethodID = 123

	}

}



define org.genivi.commonapi.someip.deployment for provider as MyService {

	

	instance commonapi.HelloWorld {

		InstanceId = "test"

		SomeIpInstanceID = 22136

	}

}

i used this generator to generate the code https://github.com/COVESA/capicxx-someip-tools/releases/tag/3.2.0.1

someone please help

Cpp code generate failed

fdepl file

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "HelloWorld.fidl"
define org.genivi.commonapi.someip.deployment for interface commonapi.HelloWorld {
    SomeIpServiceID = 4660
 
    method sayHello {
        SomeIpMethodID = 3300
    }
}
 
define org.genivi.commonapi.someip.deployment for provider MyService {
    instance commonapi.HelloWorld {
        InstanceId = "test"
        SomeIpInstanceID = 2200
    }
}

logs

➜ helloworld ../commonapi_someip_generator/commonapi-someip-generator-linux-x86_64 -ll verbos ./fidl/HelloWorld.fdepl
Executing CommonAPI SomeIP Code Generation...

Using Franca Version 0.13.1.201807231814
Error: SomeIP validation: Couldn't resolve reference to EObject 'MyService'. (file:/home/helianthus/dev_tools/helloworld/./fidl/HelloWorld.fdepl line : 11 column : 60)
Error: SomeIP validation: Root 'provider' must have a name (file:/home/helianthus/dev_tools/helloworld/./fidl/HelloWorld.fdepl line : 11 column : 51)
/home/helianthus/dev_tools/helloworld/./fidl/HelloWorld.fdepl contains validation errors !

Compilation error for CommonAPI-VSomeIP

After installed boost version 1.55 successful, and then I make the Compilation to VSomeIP。
But it's failed,"/usr/lib/x86_64-linux-gnu/libboost_system.so" file were not into this path.
My system is Ubuntu 19.10,Whether this step can only run on the old Ubuntu version?

The fail information is here:

-- Build files have been written to: /home/jerry/work/vSomeIP/build
jerry@jerry-virtual-machine:/work/vSomeIP/build$ make
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libboost_system.so', needed by 'libvsomeip.so.2.14.16'. Stop.
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/vsomeip.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
jerry@jerry-virtual-machine:
/work/vSomeIP/build$

What the different with CommonAPI-4-SOMEIP_deployment_spec and CommonAPI-SOMEIP_deployment_spec, and how to use the identifier in CommonAPI-4, it looks like the generator tools can not recognize that.

I check this two files:
image
and i used identifiers that are contained CommonAPI-4-SOMEIP_deployment_spec.fdepl
image
this the result by common-someip-generator-linux-x86_64:
image
why UNDEFIENED_EVENTGROUP_ID and static_cast< CommonAPI::SomeIP::IntegerDeployment<int32_t>* >(nullptr)?
Obviously, the generator tool does`t recognize the identifiers,SomeIpNotifierEventGroup and SomeIpIntegerBitWidth and SomeIpIntegerInvalidValue.

Communication between two devices

Hi Sir,
How can I use this code to communicate between two devices ? I followed the instructions on CommonAPI C++ SOME/IP in 10 minutes and every thing works on one host, but I want to get it work on two separated devices. Plz help.

THanks!

Issue during linking.

Hello,

I'm trying to replicate the example CommonAPI C SomeIP in 10 minutes and I keep running into issue during linking
image

I've repeated the steps 3 times so far to make sure I didn't miss anything but I get the same error.
I also tried to provide the path to vsomeip build directory during cmake but that didn't help
My make file has the full path to the vsomeip build and interface directory.

appreciate your help!

Errors in build instructions in README

The "Build instructions for Linux" section of the README.md file seem to have been copy-pasted from capicxx-core-tools and then incorrectly edited. For example:

You can build all code generators by calling maven from the command-line. Open a console and change in the directory org.genivi.commonapi.someip.releng of your CommonAPI-Tools directory

The directory "org.genivi.commapi.someip.releng" does not exist in the CommonAPI-Tools directory. It exists in the capicxx-someip-tools directory.

Also, the target file is named "org.genivi.commonapi.core.target.target", which seems like a bug.

I think the build instructions need to be scrubbed.

Is it possible to have "reliable/TCP" Attribute Changed Event Notifiers?

Hi,

I am tinkering around with the someip libs and the code generators, but now I found something I don't understand.
Btw. Great work 😄

When I try to make/set an attribute to reliable with SomeIpReliable = true within the fdepl file, the commonapi-someip-generator seems to not take this into account when generating the files.
If I modify manually the generated SomeIPStubAdapter.hpp and the SomeIPProxy.cpp and replace RT_UNRELIABLE with RT_RELIABLE, it works within my tests (checked with Wireshark).

For methods or broadcasts, this works without any changes required.

Now my questions are:

  • Should it work?
    I am asking because I checked the source code of the generator and did not find an test case for this (attribute & reliable)
  • If so, what did I configure wrong? (Please see the fidl & fdepl file below)

Thanks in advance!

Test.fidl

package test

interface Service {
version { major 1 minor 0 }

enumeration ReturnStatus {
        <** @description: the operation was successfully. **>
        OK = 0,
        <** @description: error occured while handling request. **>
        OPERATION_FAILURE = 1
    }

    method payloadToServiceUnreliable{
        in {
            String message
        }
        out {
            ReturnStatus returnStatus
        }
    }

    method payloadToServiceReliable{
        in {
            String message
        }
        out {
            ReturnStatus returnStatus
        }
    }

    method payloadFromServiceUnreliable{
        out {
            String message
            ReturnStatus returnStatus
        }
    }

    method payloadFromServiceReliable{
        out {
            String message
            ReturnStatus returnStatus
        }
    }

    broadcast broadcastUnreliable {
        out {
            String message
        }
    }

    broadcast broadcastReliable {
        out {
            String message
        }
    }

    attribute String notifierUnreliable readonly

    attribute String notifierReliable readonly
}

Test.fdepl

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-4-SOMEIP_deployment_spec.fdepl"
import "../fidl/Test.fidl"

define org.genivi.commonapi.someip.deployment for interface test.Service{

    SomeIpServiceID=1234

    method payloadToServiceUnreliable {
        SomeIpMethodID = 1
    }

    method payloadToServiceReliable {
        SomeIpReliable = true
        SomeIpMethodID = 2
    }

    method payloadFromServiceUnreliable {
        SomeIpMethodID = 3
    }

    method payloadFromServiceReliable {
        SomeIpReliable = true
        SomeIpMethodID = 4
    }

    broadcast broadcastUnreliable {
        SomeIpEventID = 56787
        SomeIpEventGroups = { 1858 }
    }

    broadcast broadcastReliable {
        SomeIpEventID = 56788
        SomeIpReliable = true
        SomeIpEventGroups = { 1859 }
    }

    attribute notifierUnreliable {
        SomeIpNotifierID = 56789
        SomeIpGetterID = 5678
        SomeIpNotifierEventGroups = { 1860 }
    }

    attribute notifierReliable {
        SomeIpNotifierID = 56790
        SomeIpGetterID = 5679
        SomeIpNotifierEventGroups = { 1861 }
        SomeIpReliable = true
    }

}

define org.genivi.commonapi.someip.deployment for provider as Service {
    instance test.Service {
        InstanceId = "test.Service"
        SomeIpInstanceID = 4567
    }
}

Event id should be encoded with the most significant bit set to 1 in FDEPL

The SOME/IP Autosar specification AUTOSAR_TR_SomeIpExample_4.2.1.pdf specifies it could support up to 65536 services with up to 32768 methods and up to 32768 notifications/events. So a notification/event identifier should range from 0 to 32767.

The distinction, in SOME/IP messages, between a method id and an event id is made by setting the most significant bit of a 16 bits value (see page 18 in AUTOSAR_TR_SomeIpExample_4.2.1.pdf) to:

  • 0 for method ids
  • 1 for event ids

However, it seems that the most significant bit should be set for event ids in FDEPL files. So, for example, an event id of 1 should be encoded as 0x8001 when specifying a SomeIpEventID value in a broadcast description,

What Should I do if I want to get the final two executables run on an ARM board?

I am a totally new baby in GENIVI someip. I followed the instructions on this page(https://github.com/GENIVI/capicxx-someip-tools/wiki/CommonAPI-C---SomeIP-in-10-minutes) and succefssfully got the final two executables HelloWorldClient and HelloWorldService.
but now I want to port these apps to ARM board. I've tried to modify the CmakeLists.txt but the result turns out to be something wrong with boost. So I wonder if there's any help from GENIVI official doc or code about cross compiling this someip demo? Sincerely thanks!!!

About Stuct Alignment

Hi, I would like to transport a struct through VSOMEIP, and I define a struct like
struct test
{
Int32 a
Int8 b
Double c
}
and I assume it will be serilize to 16 bytes since I print the sizeof(test) which equals 16, but through the network packets I captured, I found that this struct was be serilized to 13 bytes, how can I set up its alignment or padding. Thank you

[CAPI][DEBUG] Loading interface library "liblocal__commonapi_HelloWorld:v1_0__test.so" failed (liblocal__commonapi_HelloWorld:v1_0__test.so: cannot open shared object file: No such file or directory)

Hi,

I already checkout software to latest version
vsomeip: origin/update_3.1.37.1
capicxx-core-runtime:origin/master
capicxx-someip-runtime:origin/master

With default commonapi.ini,
will@ubuntu:~/work/capi/helloworld/build$ sudo ./HelloWorldService [CAPI][INFO] Loading configuration file '/etc/commonapi.ini' [CAPI][INFO] Using default binding 'dbus' [CAPI][INFO] Using default shared library folder '/usr/local/lib/commonapi' [CAPI][INFO] Registering function for creating "commonapi.HelloWorld:v1_0" stub adapter. [CAPI][INFO] Registering stub for "local:commonapi.HelloWorld:v1_0:test" 2023-11-21 15:29:29.572903 [info] Parsed vsomeip configuration in 0ms 2023-11-21 15:29:29.573670 [info] Configuration module loaded. 2023-11-21 15:29:29.573773 [info] Security disabled! 2023-11-21 15:29:29.574185 [info] Initializing vsomeip (3.4.9.1) application "". 2023-11-21 15:29:29.574436 [info] Instantiating routing manager [Proxy]. 2023-11-21 15:29:29.574998 [info] Client [ffff] is connecting to [0] at /tmp/vsomeip-0 2023-11-21 15:29:29.575314 [info] Application(unnamed, ffff) is initialized (11, 100). Successfully Registered Service! Waiting for calls... (Abort with CTRL+C) 2023-11-21 15:29:29.577417 [info] Starting vsomeip application "" (ffff) using 2 threads I/O nice 255 2023-11-21 15:29:29.579745 [info] main dispatch thread id from application: ffff () is: 7fe600bc1700 TID: 93654 2023-11-21 15:29:29.580360 [info] shutdown thread id from application: ffff () is: 7fe5fbfff700 TID: 93655 2023-11-21 15:29:29.581798 [info] io thread id from application: ffff () is: 7fe6013c2700 TID: 93653 2023-11-21 15:29:29.581919 [info] io thread id from application: ffff () is: 7fe5fb7fe700 TID: 93656 2023-11-21 15:29:32.584155 [warning] Client 0xffff request client timeout! Trying again... 2023-11-21 15:29:32.585372 [info] local_uds_client_endpoint_impl::receive_cbk Error: Operation canceled 2023-11-21 15:29:35.598540 [warning] Client 0xffff request client timeout! Trying again... 2023-11-21 15:29:35.599779 [info] local_uds_client_endpoint_impl::receive_cbk Error: Operation canceled 2023-11-21 15:29:39.608971 [warning] Client 0xffff request client timeout! Trying again... 2023-11-21 15:29:39.610129 [info] local_uds_client_endpoint_impl::receive_cbk Error: Operation canceled

But we want to use someip in commonapi, so I would like push below setting file to /etc/commonapi.ini, so the error occuring in the console.
[default]
binding=someip

[logging]
console = true
file = ./mylog.log
dlt = true
level = verbose

//log
will@ubuntu:/work/capi/helloworld/build$ ./HelloWorldService
./HelloWorldService: error while loading shared libraries: libboost_thread.so.1.82.0: cannot open shared object file: Permission denied
will@ubuntu:
/work/capi/helloworld/build$ sudo ./HelloWorldService
[CAPI][INFO] Loading configuration file '/etc/commonapi.ini'
[CAPI][INFO] Using default binding 'someip'
[CAPI][INFO] Using default shared library folder '/usr/local/lib/commonapi'
[CAPI][DEBUG] Added address mapping: local:commonapi.HelloWorld:v1_0:test <--> [1234.5678(1.0)]
[CAPI][INFO] Registering function for creating "commonapi.HelloWorld:v1_0" stub adapter.
[CAPI][DEBUG] Loading library for local:commonapi.HelloWorld:v1_0:test stub.
[CAPI][DEBUG] Loading interface library "liblocal__commonapi_HelloWorld:v1_0__test.so" failed (liblocal__commonapi_HelloWorld:v1_0__test.so: cannot open shared object file: No such file or directory)
[CAPI][INFO] Registering stub for "local:commonapi.HelloWorld:v1_0:test"
2023-11-21 15:27:28.292096 [info] Parsed vsomeip configuration in 0ms
2023-11-21 15:27:28.292810 [info] Configuration module loaded.
2023-11-21 15:27:28.293149 [info] Security disabled!
2023-11-21 15:27:28.293247 [info] Initializing vsomeip (3.4.9.1) application "".
2023-11-21 15:27:28.293472 [info] Instantiating routing manager [Proxy].
2023-11-21 15:27:28.294012 [info] Client [ffff] is connecting to [0] at /tmp/vsomeip-0
2023-11-21 15:27:28.294294 [info] Application(unnamed, ffff) is initialized (11, 100).
Successfully Registered Service!
Waiting for calls... (Abort with CTRL+C)
2023-11-21 15:27:28.296454 [info] Starting vsomeip application "" (ffff) using 2 threads I/O nice 255
2023-11-21 15:27:28.298264 [info] main dispatch thread id from application: ffff () is: 7ff3008d0700 TID: 93633
2023-11-21 15:27:28.298770 [info] shutdown thread id from application: ffff () is: 7ff2fbfff700 TID: 93634
2023-11-21 15:27:28.299906 [info] io thread id from application: ffff () is: 7ff3010d1700 TID: 93632
2023-11-21 15:27:28.300060 [info] io thread id from application: ffff () is: 7ff2fb7fe700 TID: 93635
2023-11-21 15:27:31.308967 [warning] Client 0xffff request client timeout! Trying again...
2023-11-21 15:27:31.310161 [info] local_uds_client_endpoint_impl::receive_cbk Error: Operation canceled

#22 , I also try to add local:commonapi.HelloWorld:v1_0:HelloWorld-someip.so to commonapi.ini, seem don't fix the issue.

Anyone has solution for this issue? Could you share the fix? Thanks.

Facing communication issue in SOME/IP between FRANCA Common API C++ Server and Python client

Hello,

I am working on establishing inter-process communication between a CommonAPI Some/IP C++ server (Which uses FRANCA IDL and associated deployment files) and a Some/IP python client.

Python Some/IP client

Library used for python Some/IP client:

someip 0.1.0, Pysomeip (https://pypi.org/project/someip/ )

import someip.header

from someip.sd import SOMEIPDatagramProtocol

Franca C++ Server

The C++ server that is used was setup as per the following link:

https://at.projects.genivi.org/wiki/pages/viewpage.action?pageId=5472320

Work done till now:

(C++ vsomeip server) <-------------------------- > (python client) Result: RPC Worked here.

Tried Some/IP IPC using a basic C++ vsomeip server (Which does not include CommonAPI and Franca) and the python client.

Server C++

Used the “Request/Response” example from the following link as the C++ server:

https://github.com/GENIVI/vsomeip/wiki/vsomeip-in-10-minutes

Snapshot 1 has log message on the Server Terminal Side.

Client Python

And the following example as the python client:

https://github.com/afflux/pysomeip/blob/master/tools/get.py

Snapshot 2 has the python side terminal log

I am attaching the snapshot of the IPC between the server and client:

Server:

image
Fig: Snapshot 1

Client:

image
Fig: Snapshot 2

Issue Details:

On using the same client code to establish communication with the C++server code (Containing franca and commonAPI as mentioned in https://at.projects.genivi.org/wiki/pages/viewpage.action?pageId=5472320) the C++ server returns back an error saying “Malformed Message” as shown in snapshot 3:

image
Fig: Snapshot 3

The server here uses a .fidl file while the client does not contain any franca file for binding.

Since the server used in this case requires CommonAPI is there a way to use commonAPI at the python side.

Also, Are there any code generators for python which would take .fidl files and generate python codes for the same which could then be used at the client end?

Any other suggestion as to what direction to proceed on would be very much appreciated.

Thanks in advance.

capicxx-someip-tools wiki issue

Hi,

I am following the capicxx-someip-tools wiki, and am using version 3.2.0 in commonapi-someip-generator and I encountered a validation problem when trying to generate code from HelloWorld.fdepl, namely,

grafik

This issue was fixed by adding as where indicated below
grafik

Regards,

Paula

Cannot generate the stub and proxy code using the latest commonapi-someip-generator v3.2.0.1 in Windows and Linux

Hi,

I saw it that yesterday, the latest generator were updated by the GENIVI team. I took both the commonapi-core-generator and also commonapi-someip-generator. Right now, I was able to use the commonapi-core-generator to generate my codes. However, when I try to use the commonapi-someip-generator, it shows validation error. The same .fdepl if I use it with the previos version of commonapi-someip-generator it works fine.

This is the exact message I am getting at the moment,


(commonapi-someip-generator-linux-x86_64:2147): dbind-WARNING **: 04:03:40.200: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Executing CommonAPI SomeIP Code Generation...

Using Franca Version 0.13.1.201807231814
Error: SomeIP validation: Couldn't resolve reference to EObject 'IncService'. (file:/home/user/work/INC/project-inc/./fidl/Inc.fdepl line : 24 column : 60)
Error: SomeIP validation: Root 'provider' must have a name (file:/home/user/work/INC/project-inc/./fidl/Inc.fdepl line : 24 column : 51)
/home/user/work/INC/project-inc/./fidl/Inc.fdepl contains validation errors !

Additionally, I just notice that the commonapi-someip-generator is not working in Windows as well.

Cannot find -lCommonAPI-SomeIP by using cmakelist.txt in my project

hi team,
I'm facing an issue while linking the -lCommonAPI-SomeIP library with the custom files. I've cloned from the github from cmake file at that time .so file is generated but after the I'm getting the error message as follows : /usr/bin/ld: cannot find -lCommonAPI-SomeIP
Kindly suggest what could be the issue and how it can be resolved.

Thanks in advance.

SOMEIP validation

i am following https://github.com/COVESA/capicxx-someip-tools/wiki/CommonAPI-C---SomeIP-in-10-minutes
and while running below command
./cgen/commonapi_someip_generator/commonapi-someip-generator-linux-x86_64 -d src-gen/someip ./fidl/HelloWorld.fdepl

Getting below error
Default output directory: src-gen/someip
Using Franca Version 0.13.1.201807231814
log4j:WARN No appenders could be found for logger (org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Error: SomeIP validation: Couldn't resolve reference to FInterface 'commonapi.examples.HelloHelloWorld'. (file:/mnt/d/Nis-2023/IPC/project/./fidl/HelloWorld.fdepl line : 4 column : 61)
Error: SomeIP validation: Couldn't resolve reference to FMethod 'sayHello'. (file:/mnt/d/Nis-2023/IPC/project/./fidl/HelloWorld.fdepl line : 7 column : 12)
Error: SomeIP validation: Couldn't resolve reference to FArgument 'name'. (file:/mnt/d/Nis-2023/IPC/project/./fidl/HelloWorld.fdepl line : 12 column : 13)
Error: SomeIP validation: Couldn't resolve reference to EObject 'utf16le'. (file:/mnt/d/Nis-2023/IPC/project/./fidl/HelloWorld.fdepl line : 13 column : 40)
Error: SomeIP validation: Couldn't resolve reference to EObject 'commonapi.examples.HelloHelloWorld'. (file:/mnt/d/Nis-2023/IPC/project/./fidl/HelloWorld.fdepl line : 20 column : 14)
Error: SomeIP validation: Invalid input argument '' (file:/mnt/d/Nis-2023/IPC/project/./fidl/HelloWorld.fdepl line : 12 column : 13)
/mnt/d/Nis-2023/IPC/project/./fidl/HelloWorld.fdepl contains validation errors !

cannot find the CommonAPI

Hello,
i have been struggling to compile some/ip 'HelloWorld' example,all steps from 1 to 5 are performed correctly.during the build (step 6) i get this error :

image

i understand that cmake cannot find the CommonAPI runtime, even though its compiled correctly :

image

and also installed correctly (make install) :

image

image

any suggestions !

generated code of enumeration type error(default uint8_t)

I use newest version of tool(v3.2.0.1) to generate code by .fidl file:
Using Franca Version 0.13.1.201807231814
and CommonAPI Version 3.2.0.v202012010850

In .fidl file, I define a enumeration :
enumeration TransforType {
Message_TCP = 300
Message_UDP = 400
}

The generated code:
struct TransforType : CommonAPI::Enumeration< uint8_t> {
enum Literal : uint8_t {
Message_TCP = 300,
Message_UDP = 400

};

I think default type uint8_t is wrong, it need uint32_t.

no matching function for call to 'CommonAPI::SomeIP::InputStream::readValue'

I use the newest CommonAPI and SOME/IP runtime and tools. When build my fidl and fdepl, build errors occur if using SOME/IP. The same fidl run ok if using Dbus.

build errors:
/data/code/hello-someip/src-gen/v1/hello/HelloSenderSomeIPStubAdapter.cpp:53:1: required from here /data/code/capicxx-core-runtime/include/CommonAPI/InputStream.hpp:117:46: error: no matching function for call to 'CommonAPI::SomeIP::InputStream::readValue(std::vector<v1::hello::Messages::Position>&, const CommonAPI::EmptyDeployment*&)' return get()->readValue(_value, _depl);

fidl:

package hello

interface HelloSender {
  version {major 1 minor 0}
  method sendGlobalData {
    in {
      Messages.GlobalData msg
    }
    out {
      String message
    }
  }

  method sendMessage {
    in {
      Messages.MessageBase msg
    }
    out {
      String message
    }
  }
}

typeCollection Messages {
    version {
        major 1
        minor 0
    }

    enumeration Availability {
        NotAvailable
        Valid
    }
    enumeration MessageType {
        Position
        GlobalData
    }
    enumeration PropertyType {
        Node
        Probability
    }

    struct Position {
        UInt32 accuracy
        Int32 deviation
    }
    struct MessageBase polymorphic {
    }
    struct PositionMessage extends MessageBase {
        UInt64 timestamp
        Position [ ] positions
    }
    struct PropertyValue polymorphic {
    }

    struct GlobalData {
        PropertyType type
        Availability available
        PropertyValue pv
    }
    struct GlobalDataMessage extends MessageBase {
        GlobalData [ ] data
    }

    struct UInt32PropertyValue extends PropertyValue {
        UInt32 pv
    }
    struct Int32PropertyValue extends PropertyValue {
        Int32 pv
    }

    struct MessageOnBus {
        MessageType type
        MessageBase message
    }

}

fdepl:

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "HelloMessage.fidl"

define org.genivi.commonapi.someip.deployment for interface hello.HelloSender { 
	SomeIpServiceID = 4660

	method sendGlobalData {
		SomeIpMethodID = 123
	}
	method sendMessage {
		SomeIpMethodID = 223
	}
}

define org.genivi.commonapi.someip.deployment for typeCollection hello.Messages {
	
	struct Position {
		accuracy {}
		deviation {}
	}
	struct MessageBase {
	}
	struct PositionMessage {
		timestamp {}
		positions {}
	}
	struct PropertyValue {
	}

	struct GlobalData {
		type {}
		available {}
		pv {}
	}
	struct GlobalDataMessage {
		data {}
	}

	struct UInt32PropertyValue {
		pv {}
	}
	struct Int32PropertyValue {
		pv {}
	}

	struct MessageOnBus {
		type {}
		message {}
	}
	
}

define org.genivi.commonapi.someip.deployment for provider as MyService {
	instance hello.HelloSender {
		InstanceId = "test"
		SomeIpInstanceID = 22136
	}
}

Compilation error for CommonAPI-SomeIP

I would like to raise an issue where i have a compilation error.
I tried to compile CommonAPI-SomeIP and i get this error below.

Scanning dependencies of target CommonAPI-SomeIP
[ 5%] Building CXX object CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/Address.cpp.o
[ 10%] Building CXX object CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/AddressTranslator.cpp.o
[ 15%] Building CXX object CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/ClientId.cpp.o
[ 21%] Building CXX object CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/Connection.cpp.o
[ 26%] Building CXX object CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/DispatchSource.cpp.o
[ 31%] Building CXX object CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/Factory.cpp.o
/home/v2x/testwork/capicxx-someip-runtime/src/CommonAPI/SomeIP/Factory.cpp:23:14: error: expected constructor, destructor, or type conversion before ‘(’ token
DEINITIALIZER(FactoryDeinit) {
^
/home/v2x/testwork/capicxx-someip-runtime/src/CommonAPI/SomeIP/Factory.cpp:440:1: error: expected ‘}’ at end of input
} // namespace CommonAPI
^
/home/v2x/testwork/capicxx-someip-runtime/src/CommonAPI/SomeIP/Factory.cpp:440:1: error: expected ‘}’ at end of input
CMakeFiles/CommonAPI-SomeIP.dir/build.make:182: recipe for target 'CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/Factory.cpp.o' failed
make[2]: *** [CMakeFiles/CommonAPI-SomeIP.dir/src/CommonAPI/SomeIP/Factory.cpp.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/CommonAPI-SomeIP.dir/all' failed
make[1]: *** [CMakeFiles/CommonAPI-SomeIP.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

The version that I am using is :-
CommonAPI – 3.1.12.6 (latest)
vsomeip - 2.14.16 (latest)

stubeventhelper (someip): serialization failed

I specified the array as a fixed-length array in fdepl, and the LengthWidth is 0, but it will cause the following error when executing:
[CAPI][ERROR] StubEventHelper (someip): serialization failed!

Runtime error: com.google.guava dependency via two dependency chains

Successfully built: capicxx-core-tools at tag=3.2.0.1
Successfully built: capicxx-someip-tools at tag=3.2.0.1
Then discovered that a generator, commonapi-someip-generator-linux-x86_64, fails at runtime:

$ cat org.genivi.commonapi.someip.cli.product/target/products/org.genivi.commonapi.someip.cli.product/linux/\
        gtk/x86_64/configuration/1647293754740.log
o o o
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.xtext [49] 
  Unresolved requirement: Require-Bundle: org.objectweb.asm; bundle-version="[5.0.1,6.0.0)"; \
                    resolution:="optional"
  Unresolved requirement: Require-Bundle: org.eclipse.xtext.util; visibility:="reexport"
    -> Bundle-SymbolicName: org.eclipse.xtext.util; bundle-version="2.11.0.v20170130-0808"
       org.eclipse.xtext.util [53] 
         No resolution report for the bundle.  Bundle was not resolved because of a uses constraint \
                  violation.
  org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve \
                  resource org.eclipse.xtext [osgi.identity; type="osgi.bundle"; version:\
                  Version="2.11.0.v20170130-0808"; osgi.identity="org.eclipse.xtext"; singleton:="true"] \
                  because it is exposed to package 'com.google.common.base' from resources \
                  com.google.guava [osgi.identity; type="osgi.bundle"; version:\
                  Version="18.0.0.v20161115-1643"; osgi.identity="com.google.guava"] and \
                  com.google.guava [osgi.identity; type="osgi.bundle"; version:\
                  Version="30.1.0.v20210127-2300"; osgi.identity="com.google.guava"] via two \
                  dependency chains.

Chain 1:
  org.eclipse.xtext [osgi.identity; type="osgi.bundle"; version:Version="2.11.0.v20170130-0808"; \
               osgi.identity="org.eclipse.xtext"; singleton:="true"]
    require: (osgi.wiring.bundle=org.eclipse.xtext.util)
     |    
    provide: osgi.wiring.bundle: org.eclipse.xtext.util
  com.google.guava [osgi.identity; type="osgi.bundle"; version:Version="18.0.0.v20161115-1643"; \
               osgi.identity="com.google.guava"]

Chain 2:
  org.eclipse.xtext [osgi.identity; type="osgi.bundle"; version:Version="2.11.0.v20170130-0808"; \
                   osgi.identity="org.eclipse.xtext"; singleton:="true"]
    require: (&(osgi.wiring.bundle=com.google.inject)(bundle-version>=3.0.0))
     |    
    o o o
    export: osgi.wiring.package: com.google.common.collect; uses:=com.google.common.base
    export: osgi.wiring.package=com.google.common.base
  com.google.guava [osgi.identity; type="osgi.bundle"; version:\
                   Version="30.1.0.v20210127-2300"; osgi.identity="com.google.guava"]

on Ubuntu 20.04 and:

$ mvn --version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 1.8.0_312, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.13.0-30-generic", arch: "amd64", family: "unix"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.