Advertisement
Guest User

Teptron MOVE control script

a guest
Apr 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.54 KB | None | 0 0
  1.  #!/bin/sh
  2.  DESIRED_RESPONSE="Characteristic value was written successfully"
  3.  RESPONSE=""
  4.  
  5.  for i in `seq 1 10`; do
  6.   RESPONSE="$(/opt/csrmesh/bin/csrmesh-cli move --pin 8888 --dest 43:c5:5b:04:00:06 --objid $1 --position $2)"
  7.   echo "Response: ${RESPONSE}"
  8.   # Exit if the received response matches $DESIRED_RESPONSE
  9.   # Note: The response line should start with $DESIRED_RESPONSE (but seems to have a number of whitespaces attached at the end)
  10.   if [[ $RESPONSE == $DESIRED_RESPONSE* ]]; then
  11.     exit 0
  12.   fi
  13.   sleep 1
  14.  done  
  15.  exit -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement