fixed pam and continuity options

This commit is contained in:
drmocm 2021-12-10 13:56:05 +01:00
parent 8bda007f05
commit e89a868ad5
1 changed files with 26 additions and 22 deletions

View File

@ -309,20 +309,22 @@ int main(int argc, char **argv)
{"tscheck", no_argument, 0, 't'}, {"tscheck", no_argument, 0, 't'},
{"tscheck_l", required_argument, 0, 'a'}, {"tscheck_l", required_argument, 0, 'a'},
{"nodvr", no_argument , 0, 'q'}, {"nodvr", no_argument , 0, 'q'},
{"pam", no_argument , 0, 'a'}, {"pam", no_argument , 0, 'P'},
{"pam_color", no_argument , 0, 'e'},
{"help", no_argument , 0, 'h'}, {"help", no_argument , 0, 'h'},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
c = getopt_long(argc, argv, c = getopt_long(argc, argv,
"e:c:i:f:s:d:p:hg:r:n:b:l:v:m:ota:q", "e:c:i:f:s:d:p:hg:r:n:b:l:v:m:ota:qP",
long_options, &option_index); long_options, &option_index);
if (c==-1) if (c==-1)
break; break;
switch (c) { switch (c) {
case 'e': case 'e':
odvr = 2;
color = strtoul(optarg, NULL, 0); color = strtoul(optarg, NULL, 0);
case 'P':
odvr = 2;
break; break;
case 'o': case 'o':
fout = stderr; fout = stderr;
@ -342,7 +344,7 @@ int main(int argc, char **argv)
break; break;
} }
fprintf(fout,"performing continuity check\n"); fprintf(fout,"performing continuity check\n");
odvr = 2; odvr = 3;
break; break;
case 'c': case 'c':
config = strdup(optarg); config = strdup(optarg);
@ -436,7 +438,10 @@ int main(int argc, char **argv)
" [-g gold_code] [-r root_code] [-i id] [-n device_num]\n" " [-g gold_code] [-r root_code] [-i id] [-n device_num]\n"
" [-o (write dvr to stdout)]\n" " [-o (write dvr to stdout)]\n"
" [-l (tuner source for unicable)]\n" " [-l (tuner source for unicable)]\n"
" [-t [display line](continuity check)]\n" " [-t (continuity check)]\n"
" [-a [display line] (display continuity check in line)]\n"
" [-P (output IQ diagram as pam)]\n"
" [-e [color] (use color for pam 0=green)]\n"
"\n" "\n"
" delivery_system = C,S,S2,T,T2,J83B,ISDBC,ISDBT\n" " delivery_system = C,S,S2,T,T2,J83B,ISDBC,ISDBT\n"
" polarity = h/H,v/V\n" " polarity = h/H,v/V\n"
@ -540,29 +545,28 @@ int main(int argc, char **argv)
if ((fd = open(filename ,O_RDONLY)) < 0){ if ((fd = open(filename ,O_RDONLY)) < 0){
fprintf(stderr,"Error opening input file:%s\n",filename); fprintf(stderr,"Error opening input file:%s\n",filename);
} }
if (odvr > 0){ switch (odvr){
switch (odvr){ case 1:
case 1: while(1){
while(1){ read(fd,buf,BUFFSIZE);
read(fd,buf,BUFFSIZE); write(fileno(stdout),buf,BUFFSIZE);
write(fileno(stdout),buf,BUFFSIZE);
}
break;
case 2:
fprintf(stderr,"writing pamdata\n");
init_pamdata(&iq,color);
while(1){
pam_read_data(fd, &iq);
pam_write(STDOUT_FILENO, &iq);
}
break;
} }
} else { break;
case 2:
fprintf(stderr,"writing pamdata\n");
init_pamdata(&iq,color);
while(1){
pam_read_data(fd, &iq);
pam_write(STDOUT_FILENO, &iq);
}
break;
case 3:
if( line >= 0 && line < 64 ){ if( line >= 0 && line < 64 ){
snprintf(line_start,sizeof(line_start)-1,"\0337\033[%d;0H",line); snprintf(line_start,sizeof(line_start)-1,"\0337\033[%d;0H",line);
strncpy(line_end,"\0338",sizeof(line_end)-1); strncpy(line_end,"\0338",sizeof(line_end)-1);
} }
tscheck(fd); tscheck(fd);
break;
} }
} }
} }