Пример #1
0
//==================================================================================================
int main(int argc, char **argv)
{
    struct sigaction sigact;
    int chose, res;
    int closeFlag = 0;
    struct timeval;
    Byte handleNum;
    options_t options;

    get_options(argc, argv, &options);
    print_options(&options);
    
    if (DTV_Initialize(options.dev_handle) == ERR_INVALID_DEV_TYPE)
    {
        return 0;
    }

    sigact.sa_handler = sighandler;
    sigemptyset(&sigact.sa_mask);
    sigact.sa_flags = 0;
    sigaction(SIGINT, &sigact, NULL);
    sigaction(SIGTERM, &sigact, NULL);
    sigaction(SIGQUIT, &sigact, NULL);
    sigaction(SIGPIPE, &sigact, NULL);
    
    fprintf(stderr, "\n========== ITEtech Linux DTV receiver control program ==========\n");
    GetDriverInfo();
    fprintf(stderr, "================================================================\n");

    
    if (ChannelLock(&options) < 0) 
    {
        fprintf(stderr, "Lock channel fail!\n");
    }
    else
    {
        if (options.stat_count >= 0)
        {
            ChannelStatisticTest(&options);
        }
        else 
        {
            if (options.ts_filename)
            {
                dvbout(&options);
            }
            else
            {
                dvbtraffic(&options);
            }
        }
    }

    DTV_Finalize();

    return 0;
}
Пример #2
0
//int main(int argc, char **argv)
int rx(Byte handleNum)
{
    int chose, res;
    int closeFlag = 0;
    struct timeval;
    //Byte handleNum;

    if(DTV_Initialize(handleNum) == ERR_INVALID_DEV_TYPE)
        return 0;	

    printf("\n========== ITEtech Linux DTV Testkit ==========\n");

    GetDriverInfo();

    printf("\n===============================================\n");

    while (!closeFlag)
    {

        printf("\n======= ITEtech Linux DTV Testkit =======\n");
        printf("\n1. Lock Channel              ");
        printf("\n2. Singal Quality Statistics ");
        printf("\n3. Record & Analyze Packets  ");
        printf("\n4. Mutil-Channel Lock Test   ");
        printf("\n5. Read/Write Register	   ");
        printf("\n6. echo               	   ");
        printf("\n7. ULE rx             	   ");
        printf("\n0. Quit                      ");
        printf("\n=> Please Input Your Choice: ");
        res = scanf("%d", &chose);

        switch (chose)
        {
            case 1: 
                if (ChannelLock() < 0) {
                    printf("Lock channel fail!\n");
                }

                break;

            case 2:
                ChannelStatisticTest();

                break;

            case 3:
                PacketTest();

                break;

            case 4:
                MultiChannelTest();
                break;

            case 5:
                RWRegister();
                break;
            case 6:
                echoRX();
                break;

            case 7:
                ule_rx();
                break;

            case 0:
                closeFlag = 1;
                break;
        }
    }
    DTV_Finalize();

    return 0;
}