You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows a SOME/IP message which requests a service 0x1234 with the method 0x421. Different types of SOME/IP messages follow the same procedure and their specifications can be seen here ``http://www.some-ip.com/papers/cache/AUTOSAR_TR_SomeIpExample_4.2.1.pdf``.
1590
+
1591
+
1592
+
Load the contribution::
1593
+
1594
+
load_contrib("automotive.someip")
1595
+
1596
+
Create UDP package::
1597
+
1598
+
u = UDP(sport=30509, dport=30509)
1599
+
1600
+
Create IP package::
1601
+
1602
+
i = IP(src="192.168.0.13", dst="192.168.0.10")
1603
+
1604
+
Create SOME/IP package::
1605
+
1606
+
sip = SOMEIP()
1607
+
sip.iface_ver = 0
1608
+
sip.proto_ver = 1
1609
+
sip.msg_type = "REQUEST"
1610
+
sip.retcode = "E_OK"
1611
+
sip.msg_id.srv_id = 0x1234
1612
+
sip.msg_id.method_id = 0x421
1613
+
1614
+
Add the payload::
1615
+
1616
+
sip.add_payload(Raw ("Hello"))
1617
+
1618
+
Stack it and send it::
1619
+
1620
+
p = i/u/sip
1621
+
send(p)
1622
+
1623
+
Creating a SOME/IP SD message
1624
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1625
+
1626
+
In this example a SOME/IP SD offer service message is shown with an IPv4 endpoint. Different entries and options basically follow the same procedure as shown here and can be seen at ``https://www.autosar.org/fileadmin/user_upload/standards/classic/4-3/AUTOSAR_SWS_ServiceDiscovery.pdf``.
1627
+
1628
+
Load the contribution::
1629
+
1630
+
load_contrib("automotive.someip_sd")
1631
+
1632
+
Create UDP package::
1633
+
1634
+
u = UDP(sport=30490, dport=30490)
1635
+
1636
+
The UDP port must be the one which was chosen for the SOME/IP SD transmission.
1637
+
1638
+
Create IP package::
1639
+
1640
+
i = IP(src="192.168.0.13", dst="224.224.224.245")
1641
+
1642
+
The IP source must be from the service and the destination address needs to be the chosen multicast address.
1643
+
1644
+
Create the entry array input::
1645
+
1646
+
ea = SDEntry_Service()
1647
+
1648
+
ea.type = 0x01
1649
+
ea.srv_id = 0x1234
1650
+
ea.inst_id = 0x5678
1651
+
ea.major_ver = 0x00
1652
+
ea.ttl = 3
1653
+
1654
+
Create the options array input::
1655
+
1656
+
oa = SDOption_IP4_Endpoint()
1657
+
oa.addr = "192.168.0.13"
1658
+
oa.l4_proto = 0x11
1659
+
oa.port = 30509
1660
+
1661
+
l4_proto defines the protocol for the communication with the endpoint, UDP in this case.
1662
+
1663
+
Create the SD package and put in the inputs::
1664
+
1665
+
sd = SD()
1666
+
sd.set_entryArray(ea)
1667
+
sd.set_optionArray(oa)
1668
+
spsd = sd.get_someip(True)
1669
+
1670
+
The get_someip method stacks the SOMEIP/SD message on top of a SOME/IP message, which has the desired SOME/IP values prefilled for the SOME/IP SD package transmission.
1671
+
1672
+
Stack it and send it::
1673
+
1674
+
p = i/u/spsd
1675
+
send(p)
1676
+
1677
+
1678
+
1583
1679
1584
1680
Setup
1585
1681
-----
@@ -1836,6 +1932,39 @@ can be chosen to fit the bitrate of a CAN bus under test.
1836
1932
ifconfig can0 up
1837
1933
ifconfig can1 up
1838
1934
1935
+
Raspberry Pi SOME/IP setup
1936
+
~~~~~~~~~~~~~~~~~~~~~~~~~~
1937
+
1938
+
To build a small test environment in which you can send SOME/IP messages to and from server instances or disguise yourself as a server, one Raspberry Pi, your laptop and the vsomeip library are sufficient.
1939
+
1940
+
#. | **Download image**
1941
+
1942
+
Download the latest raspbian image (``https://www.raspberrypi.org/downloads/raspbian/``) and install it on the Raspberry.
1943
+
1944
+
#. | **Vsomeip setup**
1945
+
1946
+
Download the vsomeip library on the Rapsberry, apply the git patch so it can work with the newer boost libraries and then install it.
Write some small applications which function as either a service or a client and use the scapy SOME/IP implementation to communicate with the client or the server. Examples for vsomeip applications are available on the vsomeip github wiki page (``https://github.com/GENIVI/vsomeip/wiki/vsomeip-in-10-minutes``).
0 commit comments