Skip to content

Instantly share code, notes, and snippets.

@alunux
Created May 20, 2018 14:43
Show Gist options
  • Save alunux/0eb66b6f9ec5b76f300221a33d99edf5 to your computer and use it in GitHub Desktop.
Save alunux/0eb66b6f9ec5b76f300221a33d99edf5 to your computer and use it in GitHub Desktop.
Compile: gcc -Wall ex_read_tuner.c -o ex_read_tuner
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/dvb/frontend.h>
int main(void)
{
struct dvb_frontend_info info_tuner;
int fd = open("/dev/dvb/adapter0/frontend0", O_RDONLY);
if (!fd) {
perror ("open");
return -1;
}
if (ioctl(fd, FE_GET_INFO, &info_tuner) == -1) {
perror("ioctl");
return -1;
}
printf("Informasi Tuner:\n");
printf("Nama Perangkat: %s\n"
"Freq min: %d\n"
"Freq max: %d\n"
"Freq step: %d\n"
"Freq tolerance: %d\n"
"Symbol rate min: %d\n"
"Symbol rate max: %d\n"
"Symbol rate tolerance: %d\n",
info_tuner.name,
info_tuner.frequency_min,
info_tuner.frequency_max,
info_tuner.frequency_stepsize,
info_tuner.frequency_tolerance,
info_tuner.symbol_rate_min,
info_tuner.symbol_rate_max,
info_tuner.symbol_rate_tolerance);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment