Example #1
0
 def _load_variables(self):
     ''' Load all timing Variables that are specified in the timing.ini '''
     timing_vars = []
     self.db_lookup_dict = {}
     
     ''' 1. Load the variables '''
     for reg_tim in Registrator().reg_simple_timings.keys():
         for l in Registrator().reg_simple_timings[reg_tim]:
             dic = Registrator().reg_simple_timings[reg_tim][l]
             
             lst = list(dic.keys())
             try:                            
                 lst += Registrator().db_lookup_timings[reg_tim][l]
                 self.db_lookup_dict[l] = list(Registrator().db_lookup_timings[reg_tim][l].keys())
             except:
                 pass
 
             timing_vars.append([l, lst, reg_tim, dic])
             
     ''' 2. Set table from variables'''
     self._set_timing_tab(timing_vars)
    AuKeyLengthEnum, HashMechEnum, PRF
import logging
from components.base.message.impl_bus_message_can import *  # @UnusedWildImport
import os
from components.base.message.impl_bus_message_can_fd import CANFDSegMessage
import sys
from enums.tls_enums import CompressionMethod

'''
valid values for those objects are:
    constants
    list of singleton objects and functions ['singleton_class_full_qualified', 'func_to_call']
        (args are coming from call)     
'''

reg = Registrator()
load_config = True
create_raw_config_file = False
config_file_path = os.path.join(os.path.dirname(__file__), "data/project.ini")

#===============================================================================
#     DEFINITIONS
#===============================================================================    
DEF_HASH_SIZE = {HashMechEnum.SHA1 : 20, HashMechEnum.SHA256 : 32, HashMechEnum.MD5 : 16}

#===============================================================================
#     GENERAL
#===============================================================================
BUS_MSG_CLASS = CANSegMessage
reg.reg_proj_config('General', 'BUS_MSG_CLASS', 'CAN', CANSegMessage)
reg.reg_proj_config('General', 'BUS_MSG_CLASS', 'CAN_SEG', CANSegMessage)
Example #3
0
                            iv.  DB entry corresponding to this information
    
    - Interpolation:    Does the same as the DB Lookup with the difference that more than one value is determined and from those
      (DBInterpol)      information a value is interpolated 
    
'''
import config.project_registration as preg  # NECESSARY, needs to boot first
from config.registrator import Registrator
import config.timing_reg_formulas as formula
import sys
from config import config_io
from enums.gen_cfg_enums import IniConfig
import logging
import os

reg = Registrator()
call = formula.call

load_config = True
create_raw_config_file = False
config_file_path = os.path.join(os.path.dirname(__file__), "data/timings.ini")

#===============================================================================
#     CANGateway
#===============================================================================
# Processing Time per message
GW_TRANSITION_PROCESS = 0.00000001
reg.reg_simp_timing('StdCANBus', 'SCB_GATHER_MSGS', 'LONG', 2)

#===============================================================================
#    COMPONENTS.BUS
Example #4
0
from config.registrator import Registrator
from config import config_io
from enums.gen_cfg_enums import IniConfig
import logging
import os

reg = Registrator()
load_config = True
create_raw_config_file = False
config_file_path = os.path.join(os.path.dirname(__file__), "data/can_ids.ini")

#===========================================================================
#     ECU Security
#===========================================================================
CAN_ECU_AUTH_ADVERTISE = 0x0001  # Highest Priority
CAN_ECU_AUTH_REG_MSG = 0x0002
CAN_ECU_AUTH_CONF_MSG = 0x0003

CAN_STR_AUTH_INIT_MSG_STR = 0x0005
CAN_STR_AUTH_GRANT_MSG = 0x0006
CAN_STR_AUTH_DENY_MSG = 0x0007

reg.reg_can_ids('LW_Authentication', 'CAN_ECU_AUTH_ADVERTISE', 'DEFAULT',
                0x0001)
reg.reg_can_ids('LW_Authentication', 'CAN_ECU_AUTH_REG_MSG', 'DEFAULT', 0x0002)
reg.reg_can_ids('LW_Authentication', 'CAN_ECU_AUTH_CONF_MSG', 'DEFAULT',
                0x0003)
reg.reg_can_ids('LW_Authentication', 'CAN_STR_AUTH_INIT_MSG_STR', 'DEFAULT',
                0x0005)
reg.reg_can_ids('LW_Authentication', 'CAN_STR_AUTH_GRANT_MSG', 'DEFAULT',
                0x0006)
                            iv.  DB entry corresponding to this information
    
    - Interpolation:    Does the same as the DB Lookup with the difference that more than one value is determined and from those
      (DBInterpol)      information a value is interpolated 
    
'''
import config.project_registration as preg  # NECESSARY, needs to boot first
from config.registrator import Registrator
import config.timing_reg_formulas as formula
import sys
from config import config_io
from enums.gen_cfg_enums import IniConfig
import logging
import os

reg = Registrator()
call = formula.call

load_config = True
create_raw_config_file = False
config_file_path = os.path.join(os.path.dirname(__file__), "data/timings.ini")

#===============================================================================
#     CANGateway
#===============================================================================
# Processing Time per message
GW_TRANSITION_PROCESS = 0.00000001
reg.reg_simp_timing('StdCANBus', 'SCB_GATHER_MSGS', 'LONG', 2)

#===============================================================================
#    COMPONENTS.BUS
Example #6
0
from config.registrator import Registrator
from config import config_io
from enums.gen_cfg_enums import IniConfig
import logging
import os

reg = Registrator()
load_config = True
create_raw_config_file = False
config_file_path = os.path.join(os.path.dirname(__file__), "data/can_ids.ini")

#===========================================================================
#     ECU Security
#===========================================================================
CAN_ECU_AUTH_ADVERTISE = 0x0001  # Highest Priority
CAN_ECU_AUTH_REG_MSG = 0x0002
CAN_ECU_AUTH_CONF_MSG = 0x0003

CAN_STR_AUTH_INIT_MSG_STR = 0x0005
CAN_STR_AUTH_GRANT_MSG = 0x0006
CAN_STR_AUTH_DENY_MSG = 0x0007

reg.reg_can_ids('LW_Authentication', 'CAN_ECU_AUTH_ADVERTISE', 'DEFAULT', 0x0001)
reg.reg_can_ids('LW_Authentication', 'CAN_ECU_AUTH_REG_MSG', 'DEFAULT', 0x0002)
reg.reg_can_ids('LW_Authentication', 'CAN_ECU_AUTH_CONF_MSG', 'DEFAULT', 0x0003)
reg.reg_can_ids('LW_Authentication', 'CAN_STR_AUTH_INIT_MSG_STR', 'DEFAULT', 0x0005)
reg.reg_can_ids('LW_Authentication', 'CAN_STR_AUTH_GRANT_MSG', 'DEFAULT', 0x0006)
reg.reg_can_ids('LW_Authentication', 'CAN_STR_AUTH_DENY_MSG', 'DEFAULT', 0x0007)

#===============================================================================
#     TESLA
Example #7
0
from enums.sec_cfg_enum import SymAuthMechEnum, AsymAuthMechEnum, \
    AuKeyLengthEnum, HashMechEnum, PRF
import logging
from components.base.message.impl_bus_message_can import *  # @UnusedWildImport
import os
from components.base.message.impl_bus_message_can_fd import CANFDSegMessage
import sys
from enums.tls_enums import CompressionMethod
'''
valid values for those objects are:
    constants
    list of singleton objects and functions ['singleton_class_full_qualified', 'func_to_call']
        (args are coming from call)     
'''

reg = Registrator()
load_config = True
create_raw_config_file = False
config_file_path = os.path.join(os.path.dirname(__file__), "data/project.ini")

#===============================================================================
#     DEFINITIONS
#===============================================================================
DEF_HASH_SIZE = {
    HashMechEnum.SHA1: 20,
    HashMechEnum.SHA256: 32,
    HashMechEnum.MD5: 16
}

#===============================================================================
#     GENERAL