plugin writing - need help with C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

I'm modifying a non-published pvrinput variation which sends IR commands
to a set box box - specifically, the channel number stored in
channels.conf.

12345J2:6:C12:C:0:301:300:305:A1:62006:0:1009:0
FOODJ2:63:C12:C:0:301:300:305:A1:62008:0:1019:0
       ^^  - channel number to send to external digi-box

It works fine, sending single-digit channel numbers but fails to send
double digit.  i.e. channels 1-9 are ok, but 10+ fail.

This fails because there are only codes in the lircd.conf for 0-9.

Here's an excerpt from the plugin which sends the commands:

redremote.h
<snip>
class cRedRemote : public cThread {
public:
        cRedRemote();
        ~cRedRemote();

        int  Open();
        void Tune(int channel);
        void Send(char *text);
<snip>


redremote.c
<snip>
void cRedRemote::Send(char *text)
{

    char buf[100];
    snprintf(buf,sizeof(buf), "SEND_ONCE ADB_ICAN3000 %s\n",text);

    write(fd,buf,strlen(buf));
close(fd);
fd = -1;
}
<snip>


My question is this.  I need to modify the channel sent, so that double
(or triple) channel numbers are sent as '6 3' or '1 1 7'  rather than '63'
or '117'.  i.e. put spaces between the letters.

I'm really out of my depth - can anyone point me in the right direction?

Thanks

Simon



[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux