r3692 | jgn | 2012-08-03 15:34:16 +1000 (Fri, 03 Aug 2012) | 1 line

This commit is contained in:
Jing Chen
2012-08-03 15:34:16 +10:00
committed by Douglas Clowes
parent f3486b2a17
commit 9281ebf4dd

View File

@@ -345,7 +345,11 @@ proc ::scobj::ag1010::rdValue {} {
#set ns [sct]
if {[ catch {
set data [string trim [sct result] " "]
if {[string length $data] < 1} {
broadcast $data
if {[string first "failed" $data] != -1} {
broadcast "Error in rdValue: $data"
return -code error "$data"
} elseif {[string length $data] < 1} {
broadcast "Error in rdValue: no message returned from device"
return -code error "Error in rdValue: no message returned from device"
}
@@ -596,18 +600,18 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
hsetprop $nodeName read ${ns}::getValue $scobj_hpath $rdFunc $rdPara
hsetprop $nodeName $rdFunc ${ns}::$rdFunc
if {$pollEnabled == 1} {
if {[SplitReply [environment_simulation]]=="false"} {
#if {[SplitReply [environment_simulation]]=="false"} {
$sct_controller poll $nodeName
}
#}
}
}
if {$writable == 1} {
hsetprop $nodeName write ${ns}::setValue $scobj_hpath $rdFunc $rdPara $wrPara
hsetprop $nodeName $rdFunc ${ns}::$rdFunc
if {$pollEnabled == 1} {
if {[SplitReply [environment_simulation]]=="false"} {
#if {[SplitReply [environment_simulation]]=="false"} {
$sct_controller write $nodeName
}
#}
}
}
if {1 < [string length $unit]} {