コード例 #1
0
ファイル: main_lwa_preset.py プロジェクト: sadrux/IVNS
ecu_spec = RegularECUSpec(["RegularSecureECU_15"], 20000, 20000)

# adjust the specification
ecu_spec.set_apply_jitter(0.000001)

# further settings can be found in the set_settings method of each component e.g. see RegularSecureECU class
ecu_spec.set_ecu_setting('p_stream_hold', False)
ecu_spec.set_ecu_setting('p_stream_req_min_interval', 5)
LWASpecPresets().apply_spec(ecu_spec, 'ecu')

# for a RegularECUSpec define sending actions of the ECU
ecu_spec.add_sending_actions(10, 0.25, can_registration.CAN_TEST_MSG, "TEST STRING A", 50)
ecu_spec.add_sending_actions(10, 0.5, 16, "TEST STRING B", 50)  # sends at 300, 308, 316, ...

# set the ECU already authenticated
ecu_spec.set_authenticated(True)

# generate a ECU group from the specification
ecu_group_1 = api.set_ecus(sim_env, 1, 'RegularSecureECU', ecu_spec)
 
# create further ECU groups
ecu_spec = RegularECUSpec(["RegularSecureECU_1", "RegularSecureECU_10"], 20000, 20000)
ecu_spec.set_apply_jitter(0.0001)
LWASpecPresets().apply_spec(ecu_spec, 'ecu')
ecu_group_3 = api.set_ecus(sim_env, 2, 'RegularSecureECU', ecu_spec)
 
ecu_spec = RegularECUSpec(["RegularSecureECU_18", "Any_ECU_Name"], 20000, 20000)
ecu_spec.set_apply_jitter(0.0001)
# ecu_spec.set_startup_delay(140)  # start this ecu with delay of 15

LWASpecPresets().apply_spec(ecu_spec, 'ecu')