Skip to content

Commit a27e187

Browse files
committed
get channel value in new protocol
1 parent c1f257e commit a27e187

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

javasdk/NRSDK/src/com/neuronrobotics/sdk/dyio/DyIOChannel.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,10 @@ public int getValue() {
400400
val = new DyIOChannelEvent(this,bl).getValue();
401401
}else{
402402
Object [] args =getDevice().send("bcs.io.*;0.3;;",
403-
BowlerMethod.POST,
403+
BowlerMethod.GET,
404404
"gchv",
405405
new Object[]{number});
406-
val=(Integer)args[0];
406+
val=(Integer)args[1];
407407
}
408408
setCachedValue(val);
409409
setPreviousValue(val);
@@ -806,8 +806,7 @@ private boolean isOutputMode( DyIOChannelMode m) {
806806
*/
807807

808808
public boolean setValue(ByteList data) {
809-
if(!isStreamChannel())
810-
throw new RuntimeException("Only stream channels should talk to this method");
809+
811810
if(getDevice().isLegacyParser()){
812811
int attempts = MAXATTEMPTS;
813812
if(getMode() == DyIOChannelMode.USART_RX ||getMode() == DyIOChannelMode.USART_TX )
@@ -825,6 +824,8 @@ public boolean setValue(ByteList data) {
825824
}
826825
}
827826
}else{
827+
if(!isStreamChannel())
828+
throw new RuntimeException("Only stream channels should talk to this method");
828829
getDevice().send("bcs.io.*;0.3;;",
829830
BowlerMethod.POST,
830831
"strm",

0 commit comments

Comments
 (0)