comparison recpt1/recpt1.c @ 62:c6a5c844c7fd

make some messages go stderr instead of stdout.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 09 Oct 2009 14:02:18 +0900
parents f1553492e8bb
children ca419e61f7f2
comparison
equal deleted inserted replaced
61:f1553492e8bb 62:c6a5c844c7fd
420 int rc ; 420 int rc ;
421 double P ; 421 double P ;
422 double CNR; 422 double CNR;
423 423
424 if(ioctl(fd, GET_SIGNAL_STRENGTH, &rc) < 0) { 424 if(ioctl(fd, GET_SIGNAL_STRENGTH, &rc) < 0) {
425 printf("Tuner Select Error\n"); 425 fprintf(stderr, "Tuner Select Error\n");
426 return ; 426 return ;
427 } 427 }
428 428
429 if(type == CHTYPE_GROUND) { 429 if(type == CHTYPE_GROUND) {
430 P = log10(5505024/(double)rc) * 10; 430 P = log10(5505024/(double)rc) * 10;
431 CNR = (0.000024 * P * P * P * P) - (0.0016 * P * P * P) + 431 CNR = (0.000024 * P * P * P * P) - (0.0016 * P * P * P) +
432 (0.0398 * P * P) + (0.5491 * P)+3.0965; 432 (0.0398 * P * P) + (0.5491 * P)+3.0965;
433 printf("Signal=%fdB\n", CNR); 433 fprintf(stderr, "Signal=%fdB\n", CNR);
434 } 434 }
435 else { 435 else {
436 CNR = getsignal_isdb_s(rc); 436 CNR = getsignal_isdb_s(rc);
437 printf("Signal=%fdB\n", CNR); 437 fprintf(stderr, "Signal=%fdB\n", CNR);
438 } 438 }
439 } 439 }
440 440
441 void 441 void
442 cleanup(signal_thread_data *sdata) 442 cleanup(signal_thread_data *sdata)