Skip to content

Instantly share code, notes, and snippets.

@takaswie
Created October 9, 2014 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takaswie/8910265fb67f5ef21c29 to your computer and use it in GitHub Desktop.
Save takaswie/8910265fb67f5ef21c29 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Give /dev/fw? as a parameter"
exit
elif [ ! -e $1 ] || [[ "x" == "x${1}" ]] ; then
echo "Given special file doesn't exist."
exit
fi
echo "Selector Function Blocks"
cmd="0x0108b880%02x1002ff01000000"
for i in $(seq 1 10) ; do
res=$(./firewire-request $1 fcp $(printf $cmd $i))
echo $res | grep 'response: 000: 0c'
sleep 0.25
done
echo "Feature Function Blocks (Volume Control Only)"
cmd="0x0108b881%02x1002%02x0202ffff"
for i in $(seq 1 7) ; do # Function Block ID
for c in $(seq 0 8) ; do # Channel ID
res=$(./firewire-request $1 fcp $(printf $cmd $i $c))
echo $res | grep 'response: 000: 0c'
sleep 0.25
done
done
echo "Processing Function Blocks"
cmd="0x0108b882%02x1004%02x%02x%02x0302ffff"
# Processinf FB 1
for in_plug in $(seq 1 5) ; do # Plug ID for input
for in_ch in $(seq 0 8) ; do # Channel ID for input
for out_ch in $(seq 0 8) ; do # Channel ID for output
res=$(./firewire-request $1 fcp $(printf $cmd 1 $in_plug $in_ch $out_ch))
echo $res | grep -A 1 'response: 000: 0c'
done
done
done
# Processing FB 2-5
for out_id in $(seq 2 5) ; do # Function Block ID for output
for in_plug in $(seq 0 8) ; do # Plug ID for input
for in_ch in $(seq 0 8) ; do # Channel ID for input
for out_ch in $(seq 0 2) ; do # Channel ID for output
res=$(./firewire-request $1 fcp $(printf $cmd $out_id $in_plug $in_ch $out_cha))
echo $res | grep -A 1 'response: 000: 0c'
done
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment