Driver changes made on ics1-wombat-test.

This commit is contained in:
Ferdi Franceschini
2014-07-10 09:56:09 +10:00
parent d79865edb4
commit 6aa229ee75
5 changed files with 243 additions and 214 deletions

View File

@@ -197,6 +197,9 @@ proc ::scobj::add_protekmm::read_config {} {
set name [dict get $v name]
set enabled [string tolower [dict get $v "enabled"]]
set implementation [dict get $v "implementation"]
if [dict exists $v "datype"] {
set datype [dict get $v "datype"]
}
if { !([dict exists $::config_dict $implementation]) } {
continue
}
@@ -205,6 +208,8 @@ proc ::scobj::add_protekmm::read_config {} {
continue
}
if { [string equal -nocase [dict get $v "driver"] "protekmm"] } {
set driver [dict get $v driver]
${ns}::sics_log 9 "Found ${name}: $driver"
if { [string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"] } {
if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } {
set asyncqueue "null"
@@ -216,6 +221,7 @@ proc ::scobj::add_protekmm::read_config {} {
set asyncprotocol [dict get $v "asyncprotocol"]
} else {
set asyncprotocol ${name}_protocol
${ns}::sics_log 9 "${name}:${driver}: MakeAsyncProtocol ${asyncprotocol}"
MakeAsyncProtocol ${asyncprotocol}
if { [dict exists $v "terminator"] } {
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
@@ -225,13 +231,14 @@ proc ::scobj::add_protekmm::read_config {} {
set asyncqueue ${name}_queue
set IP [dict get $v ip]
set PORT [dict get $v port]
${ns}::sics_log 9 "${name}:${driver}: MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}"
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}
if { [dict exists $v "timeout"] } {
${asyncqueue} timeout "[dict get $v "timeout"]"
}
}
set arg_list [list]
foreach arg {name ip port datype id scale offset interval} {
foreach arg {id} {
if {[dict exists $v $arg]} {
lappend arg_list "[dict get $v $arg]"
} else {
@@ -239,6 +246,7 @@ proc ::scobj::add_protekmm::read_config {} {
error "Missing configuration value $arg"
}
}
${ns}:sics_log 9 "add_protekmm ${name} aqadapter ${asyncqueue} {*}$arg_list"
add_protekmm ${name} "aqadapter" ${asyncqueue} {*}$arg_list
}
}