Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: diseqc positioner support for VDR
Niels de Carpentier wrote:
> I've implemented diseqc positioner support for VDR. The patched vdr program
> will use an extra field in the channels.conf file to indicate the satelite
> number. It will read the old format, and convert to the new format the first
> time it's started.
I added support for a positioner connected to an analog satellite receiver.
Transmitting a satellite number is implemented with LIRC. Attached diff
is for dvbapi.c patched with the vdr-pos.diff.
Matjaz
[ Part 2: "Attached Text" ]
20a21,23
> #include <sys/socket.h>
> #include <sys/types.h>
> #include <sys/un.h>
1373a1377,1409
> #if defined REMOTE_LIRC
>
> bool cDvbApi::SetSatPos(int SatNR)
> {
> unsigned int i;
> char buf[8];
> struct sockaddr_un addr;
> int fd;
> char buffer[32];
>
> if (videoDev >= 0) {
> usleep(300000);
> addr.sun_family=AF_UNIX;
> strcpy(addr.sun_path, "/dev/lircd");
> fd=socket(AF_UNIX,SOCK_STREAM,0);
> if(fd<0)
> return false;
> if(connect(fd, (struct sockaddr *)&addr, sizeof(addr))<0)
> return false;
> sprintf(buf, "%d", SatNR);
> for(i=0; i<strlen(buf); i++){
> sprintf(buffer, "SEND_ONCE ANALOG %c\n", buf[i]);
> write(fd, (void *)buffer, strlen(buffer));
> usleep(300000);
> }
> close(fd);
> return true;
> }
> return false;
> }
>
> #else
>
1391a1428,1429
>
> #endif
Home |
Main Index |
Thread Index