Advertisement
cindy_wijaya

Baca tulis serial

Oct 7th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1.  
  2. stty -F $(uci get owrt.alat.devio) 9600
  3. str_status="["
  4. while true;
  5. do
  6. j=0
  7. cat $(uci get owrt.alat.devio) | while read ligne
  8. do
  9. j=$(($j+1))
  10. if [ $j -gt "1" ]; then
  11. echo $ligne > /tmp/devio.txt
  12. logger "raw data alat terkirim"
  13. #------ nulis port--------------
  14. if [ "$str_status" == "[" ]; then
  15. str_status="]"
  16. elif [ "$str_status" == "]" ]; then
  17. str_status="["
  18. fi
  19. echo -en $str_status > /dev/ttyDEVIO
  20. #------ nulis port--------------
  21. fi
  22. done
  23.  
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement