#!/bin/sh

[ $# -ne 1 ] && echo "$0 {command}" && exit 1


send_cmd()
{
line=${1}
echo ${line} > /dev/Serial-BtoUsbIrRemocon
}


# TMYのTVチューナーTSTB-R50操作用
case "${1}" in
power)
send_cmd "07200033003010";;
screen_size)
send_cmd "07200033003034";;
3digit_input)
send_cmd "0720003300302A";;
ground_d)
send_cmd "07200033003039";;
bs)
send_cmd "0720003300303A";;
cs)
send_cmd "0720003300303B";;
1)
send_cmd "07200033003011";;
2)
send_cmd "07200033003012";;
3)
send_cmd "07200033003013";;
4)
send_cmd "07200033003014";;
5)
send_cmd "07200033003015";;
6)
send_cmd "07200033003016";;
7)
send_cmd "07200033003017";;
8)
send_cmd "07200033003018";;
9)
send_cmd "07200033003019";;
10)
send_cmd "0720003300301A";;
11)
send_cmd "0720003300301B";;
12)
send_cmd "0720003300301C";;
menu)
send_cmd "0720003300301D";;
data)
send_cmd "07200033003044";;
up)
send_cmd "07200033003022";;
left)
send_cmd "07200033003024";;
right)
send_cmd "07200033003025";;
down)
send_cmd "07200033003023";;
ok)
send_cmd "07200033003026";;
prog_schedls)
send_cmd "0720003300302C";;
back)
send_cmd "07200033003037";;
prog_up)
send_cmd "07200033003028";;
prog_down)
send_cmd "07200033003029";;
com_prog_schedls)
send_cmd "0720003300302F";;
prog_info)
send_cmd "0720003300302D";;
disp)
send_cmd "0720003300302B";;
blue)
send_cmd "07200033003040";;
red)
send_cmd "07200033003041";;
green)
send_cmd "07200033003042";;
yellow)
send_cmd "07200033003043";;
reserv_list)
send_cmd "0720003300304F";;
rec_list)
send_cmd "0720003300304E";;
subtitles)
send_cmd "07200033003033";;
sound_switch)
send_cmd "07200033003032";;
recording_setup)
send_cmd "07200033003050";;
stop)
send_cmd "07200033003053";;
pause)
send_cmd "0720003300304B";;
record)
send_cmd "07200033003051";;
rewind)
send_cmd "07200033003054";;
forward)
send_cmd "0720003300304C";;
*)
echo "Error: Illegal command."
exit 1
;;
esac
