Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include <stdlib.h>
00009 #include <stdio.h>
00010 #include <fcntl.h>
00011
00012 #include <sys/ioctl.h>
00013 #include <sys/types.h>
00014 #include <sys/stat.h>
00015
00016
00017
00018
00019
00020 #define VIDEO1394_IOC_UNLISTEN_CHANNEL _IOW('#', 0x11, int)
00021
00022 int main(int argc, char **argv) {
00023
00024 if (argc < 3) {
00025 printf("Not enough arguments.\n");
00026 printf("Usage: ioctl_open <device> <channel>\n");
00027 printf(" device - the video1394 character device driver (by default \"/dev/video1394/0\" if your host card is port 0)\n");
00028 printf(" channel - the IEEE 1394 ISO channel previously allocated to the camera (usually numbered from 0 on each host)\n");
00029 printf("Example: ioctl_open /dev/video1394/0 0\n");
00030 return -1;
00031 }
00032
00033 char* device = argv[1];
00034 int channel = atoi(argv[2]);
00035 printf("Calling ioctl(open(%s, O_RDONLY), VIDEO1394_IOC_UNLISTEN_CHANNEL, %d)...\n", device, channel);
00036
00037 ioctl(open(device, O_RDONLY), VIDEO1394_IOC_UNLISTEN_CHANNEL, channel);
00038 }
00039