Posted to tcl by grummund at Thu Jun 01 17:46:52 GMT 2017view raw

  1. #!/usr/bin/expect -f
  2.  
  3. set device /dev/ttyUSB0
  4. exp_spawn -open [open $device RDWR]
  5. exp_stty 9600 cs8 parenb -cstopb -raw < $device
  6.  
  7. fconfigure stdin -translation binary
  8. fconfigure stdout -translation binary
  9.  
  10. send "\xE0\x10\x4E\x74\x00\x02\x04\x42\x78\x00\x00\x4F\x85"
  11. expect "\xE0\x10\x4E\x74\x00\x02\x01\x4B"
  12.  
  13. exit
  14.  
  15.