Skip to content

Commit

Permalink
move name to requestsdata to be usable in extension functions for Req…
Browse files Browse the repository at this point in the history
…uestsData
  • Loading branch information
froks committed Jan 26, 2022
1 parent 0dff34a commit ffd19d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions doip-sim-ecu-dsl/src/main/kotlin/SimDsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fun MutableList<RequestMatcher>.removeByName(name: String): RequestMatcher? {

data class ResetHandler(val name: String?, val handler: (SimEcu) -> Unit)

open class RequestsData(requests: List<RequestMatcher> = emptyList(), resetHandler: List<ResetHandler> = emptyList()) {
open class RequestsData(val name: String, requests: List<RequestMatcher> = emptyList(), resetHandler: List<ResetHandler> = emptyList()) {
/**
* List of all defined requests in the order they were defined
*/
Expand Down Expand Up @@ -317,13 +317,13 @@ open class RequestsData(requests: List<RequestMatcher> = emptyList(), resetHandl
* Define the data associated with the ecu
*/
open class EcuData(
val name: String,
name: String,
var physicalAddress: Int = 0,
var functionalAddress: Int = 0,
var nrcOnNoMatch: Boolean = true,
requests: List<RequestMatcher> = emptyList(),
resetHandler: List<ResetHandler> = emptyList()
) : RequestsData(requests, resetHandler)
) : RequestsData(name, requests, resetHandler)

val gateways: MutableList<GatewayData> = mutableListOf()
val gatewayInstances: MutableList<SimGateway> = mutableListOf()
Expand Down
2 changes: 1 addition & 1 deletion doip-sim-ecu-dsl/src/main/kotlin/SimGateway.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import doip.simulation.standard.StandardTcpConnectionGateway
import java.net.InetAddress
import kotlin.properties.Delegates

open class GatewayData(val name: String) : RequestsData() {
open class GatewayData(name: String) : RequestsData(name) {
/**
* Network address this gateway should bind on (default: 0.0.0.0)
*/
Expand Down

0 comments on commit ffd19d9

Please sign in to comment.