LIN
feral3gp.feral.lin(config, director=Simulation.director_de)
¶
Source code in feral3gp/feral/network/lin.py
53 54 55 56 57 58 59 60 61 |
|
feral3gp.feral.add_schedule(name, network)
¶
Adds a schedule for the LIN bus master.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the schedule |
required |
network
|
LINNetwork
|
The LIN network |
required |
Returns:
Type | Description |
---|---|
LINSchedule
|
The created :class: |
Source code in feral3gp/feral/network/lin.py
115 116 117 118 119 120 121 122 |
|
feral3gp.feral.LINSchedule
dataclass
¶
Source code in feral3gp/feral/network/lin.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
add_event_triggered_frame(collision_table_name, delay, lin_id, associated_lin_ids)
¶
Appends a new event triggered frame to this schedule. Given delay will be rounded up to next multiple of the time base.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collision_table_name
|
str
|
Name of the schedule table that will get executed once on collision |
required |
delay
|
int
|
The frame duration in multiples of the time base |
required |
lin_id
|
int
|
LIN ID associated with the event triggered frame |
required |
associated_lin_ids
|
List[int]
|
LIN IDs of unconditional frames that are associated with this event triggered frame |
required |
Returns:
Type | Description |
---|---|
LINSchedule
|
The :class: |
Source code in feral3gp/feral/network/lin.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
add_sporadic_frame(delay, lin_ids)
¶
Appends a new sporadic frame to this schedule. (sender is always the master) Given delay will be rounded up to next multiple of the time base.
Note -- If a sporadic frame is sent by the master, the message inside the master be consumed. It cannot be sent again.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
delay
|
int
|
The frame duration in multiples of the time base |
required |
lin_ids
|
List[int]
|
List of LIN IDs associated with the sporadic frame. First has the highest priority. |
required |
Returns:
Type | Description |
---|---|
LINSchedule
|
The :class: |
Source code in feral3gp/feral/network/lin.py
84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
add_unconditional_frame(sender_idx, delay, lin_id)
¶
Appends a new unconditional frame to this schedule. Given delay will be rounded up to next multiple of the time base.
Note -- If an unconditional frame is sent by the master, the message inside the master will not be consumed and will get sent again next time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sender_idx
|
int
|
Producer of this frame, 0 for master, 1..16 for nth slave |
required |
delay
|
int
|
The frame duration in multiples of the time base |
required |
lin_id
|
int
|
LIN ID associated with the unconditional frame |
required |
Returns:
Type | Description |
---|---|
LINSchedule
|
The schedule itself to chain addXXXFrame commands |
Source code in feral3gp/feral/network/lin.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
feral3gp.feral.LINConfig
dataclass
¶
Bases: NetworkConfig
The configuration of the LIN network
Source code in feral3gp/feral/network/lin_config.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
bit_rate: int = 19200
class-attribute
instance-attribute
¶
The bitrate of the bis in Bits/s
inter_byte_space: int = 0
class-attribute
instance-attribute
¶
The length if the Inter-Byte-Space in ns
jitter_range: typing.Tuple[int, int] = (0, 0)
class-attribute
instance-attribute
¶
The range of the jitter for master to start sending in nanoseconds. Must both be positive. First element lower bound, second one upper bound.
name: str = 'unnamed LIN network'
class-attribute
instance-attribute
¶
The name of the network
response_space: int = 0
class-attribute
instance-attribute
¶
The length of the Response Space in ns
schedule_start_delay: int = 0
class-attribute
instance-attribute
¶
The time that passes before LIN master starts the schedule
starting_schedule_name: str = None
class-attribute
instance-attribute
¶
The name of the starting schedule (or None if not defined yet).
sync_break_delimiter_length_in_bits: int = 1
class-attribute
instance-attribute
¶
The size of the Sync Break Delimiter in bits
sync_break_length_in_bits: int = 13
class-attribute
instance-attribute
¶
The size of the Sync Break in bits (excluding the delimiter length)
time_base: int = feral.millis(5)
class-attribute
instance-attribute
¶
The time base for the LIN master in ns. Must be positive.