namespace eval rsport {} {
}

proc stdConfig::rsport {} {
  controller bin rsport-crc

  prop startcmd "hex 96 02 1e ea / hex"
  obj RSPort -none
  kids "AG 1016 settings" {

    node fwdpower rd
    prop readcmd "hex 96 02 1e ea / skip3 int2 int2 skip2 int2"
    prop update rsport::updmeas
    
    node revpower upd
    
    node temperature upd
  }
}

proc rsport::updmeas {} {
  sct update [expr [lindex [sct result] 0] * 0.1]
  updateval [sct parent]/revpower [expr [lindex [sct result] 1] * 0.1]
  updateval [sct parent]/temperature [expr [lindex [sct result] 2] / 26.4]
  return idle
}
