echo "__Test Begins"
date
echo "__Initial 10secs Begins"
sleep 10

{   sleep 2;
    echo 4; sleep 1; echo 1; sleep 1; echo 581; sleep 5;
    echo 4; sleep 1; echo 1; sleep 1; echo 581; sleep 5;
    echo 4; sleep 1; echo 17;} | ./mfcc_sample_app


echo "__EPS, OBC TTY, COMMS, PS TTY, OBC_TO_PS Test Begins"
date
{   sleep 2; 
    echo 4; sleep 1; echo 1; sleep 1; echo 200; sleep 5; 
    #echo 1 117; sleep 5; 
    echo 4; sleep 1; echo 1; sleep 1; echo 211; sleep 1; echo 9; sleep 1; echo 1; sleep 30; 
    echo 4; sleep 1; echo 1; sleep 1; echo 211; sleep 1; echo 12; sleep 1; echo 1; sleep 30; 
    #echo 1 211 12 1; sleep 30; 
    echo 4; sleep 1; echo 1; sleep 1; echo 215; sleep 5;
    echo 4; sleep 1; echo 2; sleep 1; echo 300; sleep 30; 
    echo 4; sleep 1; echo 3; sleep 1; echo 134; sleep 1; echo 117; sleep 1; echo  pwd; sleep 5; 
    echo 4; sleep 1; echo 1; sleep 1; echo 553; sleep 1; echo 1; sleep 5;
    echo 4; sleep 1; echo 17;} | ./mfcc_sample_app
date
echo "__EPS, OBC TTY, COMMS, PS TTY, OBC_TO_PS Test Begins"

#echo "__Scheduler trigger Begins"
#date
#{   sleep 2; 
#    echo 1 550; sleep 5; 
#    echo 1 548 0; sleep 20; 
#    echo 1 549 0 1; sleep 10; 
#    echo 17;} | ./mfcc_sample_app
#date
#echo "__Scheudler trigger Ends"

i=1;

while true
do
    echo "__EPS Sequence Iteration count: $i"
    date
    {   sleep 5; 
        echo 4; sleep 1; echo 3; sleep 1; echo 134; sleep 1; echo  117; sleep 1; echo  pwd; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo 201; sleep 1; echo 1; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo 203; sleep 1; echo 1; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo 206; sleep 1; echo 1; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo 208; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo 209; sleep 5; 
        echo 4; sleep 1; echo 17;} | ./mfcc_sample_app
    echo "__COMMS Sequence Iteration count: $i"
    date
    {   sleep 5; 
        echo 4; sleep 1; echo 2; sleep 1; echo 350; sleep 30; 
        echo 4; sleep 1; echo 2; sleep 1; echo 369; sleep 30; 
        echo 4; sleep 1; echo 2; sleep 1; echo 390; sleep 30; 
        echo 4; sleep 1; echo 2; sleep 1; echo 400; sleep 30; 
        #echo 2 408 10 200 500 100; sleep 100; 
        echo 4; sleep 1; echo 2; sleep 1; echo  350; sleep 30; 
        echo 4; sleep 1; echo 2; sleep 1; echo  369; sleep 30; 
        echo 4; sleep 1; echo 2; sleep 1; echo  390; sleep 30; 
        echo 4; sleep 1; echo 2; sleep 1; echo  400; sleep 30; 
        echo 4; sleep 1; echo 17;} | ./mfcc_sample_app
    echo "__OBC Sequence Iteration count: $i"
    date
    {   sleep 5;
        echo 4; sleep 1; echo 1; sleep 1; echo  501; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  510; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  512; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  514; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  516; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  518; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  520; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  5; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  6; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  7; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  8; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  9; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  10; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  11; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  12; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  13; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  19; sleep 5; 
        echo 4; sleep 1; echo 1; sleep 1; echo  560; sleep 1; echo  20; sleep 5; 
        echo 4; sleep 1; echo 17;} | ./mfcc_sample_app

    ran_num=$(shuf -i 60-60 -n1)
    date
    echo "__After all sequence read iteration $i Sleep Duration is $ran_num"
    sleep $ran_num
    i=$((i+1))
done

