@@ -1107,7 +1107,7 @@ def get_signals(signal_array, frame, ea, multiplex_id, float_factory, bit_offset
1107
1107
if compu_method is None and datdefprops is not None :
1108
1108
compu_method = ea .follow_ref (datdefprops , "COMPU-METHOD-REF" )
1109
1109
if compu_method is None : # AR4
1110
- compu_method = ea .get_child (isignal , "COMPU-METHOD" )
1110
+ compu_method = ea .follow_ref (isignal , "COMPU-METHOD-REF " )
1111
1111
base_type = ea .follow_ref (isignal , "BASE-TYPE-REF" )
1112
1112
encoding = ea .get_child (base_type , "BASE-TYPE-ENCODING" )
1113
1113
if encoding is not None and encoding .text == "IEEE754" :
@@ -1128,7 +1128,7 @@ def get_signals(signal_array, frame, ea, multiplex_id, float_factory, bit_offset
1128
1128
#####################################################################################################
1129
1129
if compu_method is None :
1130
1130
logger .debug ('No Compmethod found!! - fuzzy search in syssignal.' )
1131
- compu_method = ea .get_child (system_signal , "COMPU-METHOD" )
1131
+ compu_method = ea .follow_ref (system_signal , "COMPU-METHOD-REF " )
1132
1132
1133
1133
# decode compuMethod:
1134
1134
(values , factor , offset , unit_elem , const ) = decode_compu_method (compu_method , ea , float_factory )
@@ -1664,25 +1664,51 @@ def extract_cm_from_ecuc(com_module, ea):
1664
1664
1665
1665
def decode_ethernet_helper (ea , float_factory ):
1666
1666
found_matrixes = {}
1667
+
1668
+ socket_connetions = ea .findall ("SOCKET-CONNECTION-IPDU-IDENTIFIER" )
1669
+ pdu_triggering_header_id_map = {}
1670
+ # network_endpoints = pc.findall('.//' + ns + "NETWORK-ENDPOINT")
1671
+ for socket_connetion in socket_connetions :
1672
+ header_id = ea .get_child (socket_connetion , "HEADER-ID" )
1673
+ ipdu_triggering = ea .follow_ref (socket_connetion , "PDU-TRIGGERING-REF" )
1674
+ try :
1675
+ pdu_triggering_header_id_map [ipdu_triggering ] = header_id .text
1676
+ except :
1677
+ pass
1678
+
1679
+
1667
1680
ecs = ea .findall ('ETHERNET-CLUSTER' )
1668
1681
for ec in ecs :
1669
1682
baudrate_elem = ea .find ("BAUDRATE" , ec )
1670
1683
physical_channels = ea .findall ("ETHERNET-PHYSICAL-CHANNEL" , ec )
1671
1684
for pc in physical_channels :
1672
- db = canmatrix .CanMatrix ()
1685
+ db = canmatrix .CanMatrix (type = canmatrix . matrix_class . SOMEIP )
1673
1686
db .baudrate = baudrate_elem .text if baudrate_elem is not None else 0
1674
1687
db .add_signal_defines ("LongName" , 'STRING' )
1675
1688
channel_name = ea .get_element_name (pc )
1676
1689
found_matrixes [channel_name ] = db
1677
- ipdu_triggerings = ea .findall ("PDU-TRIGGERING" , pc )
1678
1690
1679
- #network_endpoints = pc.findall('.//' + ns + "NETWORK-ENDPOINT")
1680
- for ipdu_triggering in ipdu_triggerings :
1691
+ for socket_connetion in ea .findall ("SOCKET-CONNECTION-IPDU-IDENTIFIER" , pc ):
1692
+ header_id = ea .get_child (socket_connetion , "HEADER-ID" )
1693
+ ipdu_triggering = ea .follow_ref (socket_connetion , "PDU-TRIGGERING-REF" )
1694
+ # for ipdu_triggering in ea.findall("PDU-TRIGGERING", pc):
1681
1695
ipdu = ea .follow_ref (ipdu_triggering , "I-PDU-REF" )
1696
+ if ipdu is not None and 'SECURED-I-PDU' in ipdu .tag :
1697
+ payload = ea .follow_ref (ipdu , "PAYLOAD-REF" )
1698
+ ipdu = ea .follow_ref (payload , "I-PDU-REF" )
1699
+
1682
1700
ipdu_name = ea .get_element_name (ipdu )
1683
1701
logger .info ("ETH PDU " + ipdu_name + " found" )
1684
1702
target_frame = canmatrix .Frame (name = ipdu_name )
1685
- pdu_sig_mapping = ea .follow_all_ref (ipdu , "I-SIGNAL-TO-I-PDU-MAPPING-REF" )
1703
+ try :
1704
+ target_frame .header_id = int (header_id .text )
1705
+ except :
1706
+ try :
1707
+ target_frame .header_id = int (pdu_triggering_header_id_map [ipdu_triggering ])
1708
+ except :
1709
+ target_frame .header_id = 0
1710
+ # continue
1711
+ pdu_sig_mapping = ea .findall ("I-SIGNAL-TO-I-PDU-MAPPING" , ipdu )
1686
1712
get_signals (pdu_sig_mapping , target_frame , ea , None , float_factory )
1687
1713
db .add_frame (target_frame )
1688
1714
return found_matrixes
0 commit comments