mirror of
				https://github.com/DigitalDevices/dddvb.git
				synced 2025-03-01 10:35:23 +00:00 
			
		
		
		
	add test app for new modulator API
This commit is contained in:
		| @@ -9,6 +9,9 @@ modt: modt.c | ||||
| setmod: setmod.c | ||||
| 	gcc -o setmod setmod.c -I../include/ | ||||
|  | ||||
| setmod2: setmod2.c | ||||
| 	gcc -o setmod2 setmod2.c -I../include/ | ||||
|  | ||||
| flashprog: flashprog.c | ||||
| 	gcc -o flashprog flashprog.c | ||||
|  | ||||
|   | ||||
							
								
								
									
										47
									
								
								apps/setmod2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								apps/setmod2.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,47 @@ | ||||
| #include <errno.h> | ||||
| #include <stdio.h> | ||||
| #include <ctype.h> | ||||
| #include <string.h> | ||||
| #include <unistd.h> | ||||
| #include <sys/types.h> | ||||
| #include <sys/stat.h> | ||||
| #include <stdint.h> | ||||
| #include <stdlib.h> | ||||
| #include <fcntl.h> | ||||
| #include <sys/ioctl.h> | ||||
| #include <pthread.h> | ||||
|  | ||||
| #include <linux/dvb/mod.h> | ||||
|  | ||||
| static int set_property(int fd, uint32_t cmd, uint32_t data) | ||||
| { | ||||
| 	struct dtv_property p; | ||||
| 	struct dtv_properties c; | ||||
| 	int ret; | ||||
|  | ||||
| 	p.cmd = cmd; | ||||
| 	c.num = 1; | ||||
| 	c.props = &p; | ||||
| 	p.u.data = data; | ||||
| 	ret = ioctl(fd, FE_SET_PROPERTY, &c); | ||||
| 	if (ret < 0) { | ||||
| 		fprintf(stderr, "FE_SET_PROPERTY returned %d\n", errno); | ||||
| 		return -1; | ||||
| 	} | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| int main() | ||||
| { | ||||
| 	int fd; | ||||
| 	struct dvb_mod_params mp; | ||||
| 	struct dvb_mod_channel_params mc; | ||||
|  | ||||
| 	fd = open("/dev/dvb/adapter0/mod0", O_RDONLY); | ||||
|  | ||||
| 	set_property(fd, MOD_MODULATION, QAM_256); | ||||
| 	set_property(fd, MOD_SYMBOL_RATE, 6900000); | ||||
| 	set_property(fd, MOD_FREQUENCY, 114000000); | ||||
| 	close(fd); | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user