diff -ru --new-file lirc-0.7.0pre4-clean/configure lirc-0.7.0pre4-dvico/configure --- lirc-0.7.0pre4-clean/configure 2004-03-26 06:16:13.000000000 +1000 +++ lirc-0.7.0pre4-dvico/configure 2004-07-31 18:44:39.000000000 +1000 @@ -194,7 +194,7 @@ none, any, act200l, animax, atiusb, audio, avermedia, avermedia_vdomate, avermedia98, bestbuy, bestbuy2, breakoutbox, bte, caraca, - chronos, comX, creative_infracd, dsp, + chronos, comX, creative_infracd, dsp, dvico, cph03x, cph06x, creative, devinput, flyvideo, gvbctv5pci, hauppauge, hauppauge_dvb, irdeo, irdeo_remote, irman, @@ -7792,7 +7792,7 @@ echo "$ac_t""" 1>&6 possible_drivers="(none) (bte) (creative_infracd) (devinput) (dsp) \ - (irreal) (livedrive_midi) (livedrive_seq) (logitech) \ + (dvico) (irreal) (livedrive_midi) (livedrive_seq) (logitech) \ (mediafocusI) (mp3anywhere) (pctv) (remotemaster) (silitek) \ (slinke) (tira) (uirt2) (uirt2_raw) (udp)" @@ -8182,6 +8182,9 @@ dsp) hw_module="${hw_module} hw_dsp.o receive.o" ;; + dvico) + hw_module="${hw_module} hw_dvico.o" + ;; irman) hw_module="${hw_module} hw_irman.o serial.o" irman_lib=-lirman @@ -8707,6 +8710,12 @@ HW_DEFAULT="hw_uirt2_raw" fi +if test "$driver" = "dvico"; then + lirc_driver="none" + hw_module="hw_dvico.o" + HW_DEFAULT="hw_dvico" +fi + #END HARDWARE HEURISTIC cat >> confdefs.h < + * + * Distribute under GPL version 2 or later. + * + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include + +#include "hardware.h" +#include "ir_remote.h" +#include "lircd.h" +#include "receive.h" + + +static ir_code lastcode, code; +struct timeval last,now; +int repeating; +lirc_t gap; + +int dvico_init() +{ + logprintf(LOG_INFO, "initializing '%s'", hw.device); + + if ((hw.fd = open(hw.device, O_RDONLY)) < 0) { + logprintf(LOG_ERR, "unable to open '%s'", hw.device); + return 0; + } + + return 1; +} + + +int dvico_deinit(void) +{ + logprintf(LOG_INFO, "closing '%s'", hw.device); + close(hw.fd); + hw.fd=-1; + return 1; +} + + +int dvico_decode(struct ir_remote *remote, + ir_code *prep, ir_code *codep, ir_code *postp, + int *repeat_flagp, lirc_t *remaining_gapp) +{ + *prep = 0; + *codep = code & ~0x008000; + *postp = 0; + *repeat_flagp = repeating; + *remaining_gapp = 0; + + return 1; +} + +char *dvico_rec(struct ir_remote *remotes) +{ + unsigned char b[8]; + int rd; + +reread: + rd = read(hw.fd, b, 8); + if (rd != sizeof(b)) { + logprintf(LOG_ERR, "error reading '%s'", hw.device); + return 0; + } + + /* Check prefix */ + if (b[0] != 0x46 || b[1] != 0x00 || b[2] != 0x01 || b[3] != 0x00) + return 0; + + /* Record the code */ + code = (b[4] << 16) + (b[5] << 8) + (b[6] << 0); + + /* Determine if we are repeating */ + if (! (code & 0x008000)) { + // first touch of code we've seen + gettimeofday(&last, NULL); + repeating = 0; + } else if ((lastcode & ~0x008000) == (code & ~0x008000)) { + gettimeofday(&now, NULL); + gap=(now.tv_sec-last.tv_sec)*1000000+ + now.tv_usec-last.tv_usec; + if (gap > 250000) { + /* Repeat without start seen? */ + goto reread; + } + last = now; + repeating = 1; + } else { + gettimeofday(&last, NULL); + repeating = 0; + } + lastcode = code; + + return decode_all(remotes); +} + + + +struct hardware hw_dvico= +{ + "/dev/usb/hiddev0", /* "device" */ + -1, /* fd (device) */ + LIRC_CAN_REC_LIRCCODE, /* features */ + 0, /* send_mode */ + LIRC_MODE_LIRCCODE, /* rec_mode */ + 32, /* code_length */ + dvico_init, /* init_func */ + NULL, /* config_func */ + dvico_deinit, /* deinit_func */ + NULL, /* send_func */ + dvico_rec, /* rec_func */ + dvico_decode, /* decode_func */ + NULL, /* readdata */ + "dvico" +}; diff -ru --new-file lirc-0.7.0pre4-clean/remotes/dvico/fusionhdtv-dvbt1 lirc-0.7.0pre4-dvico/remotes/dvico/fusionhdtv-dvbt1 --- lirc-0.7.0pre4-clean/remotes/dvico/fusionhdtv-dvbt1 1970-01-01 10:00:00.000000000 +1000 +++ lirc-0.7.0pre4-dvico/remotes/dvico/fusionhdtv-dvbt1 2004-07-31 18:33:02.000000000 +1000 @@ -0,0 +1,62 @@ +# +# contributed by Chris Pascoe +# +# brand: DVICO +# model no. of remote control: DVB-T +# devices being controlled by this remote: +# + +begin remote + + name DVICO + bits 32 + eps 0 + aeps 0 + + one 0 0 + zero 0 0 + pre_data_bits 0 + gap 195755 + post_data_bits 0 + toggle_bit 17 + + begin codes + 1 0x0000000000F91100 + 2 0x0000000000F91200 + 3 0x0000000000F91300 + 4 0x0000000000F91400 + 5 0x0000000000F91500 + 6 0x0000000000F91600 + 7 0x0000000000F91700 + 8 0x0000000000F91800 + 9 0x0000000000F91900 + 0 0x0000000000F91000 + power 0x0000000000F90A00 + pcoff 0x0000000000F90C00 + camera 0x0000000000F91A00 + record 0x0000000000F91B00 + chup 0x0000000000F90000 + chdown 0x0000000000F90100 + voldown 0x0000000000F90300 + volup 0x0000000000F90200 + playpause 0x0000000000F91F00 + rew 0x0000000000F91C00 + stop 0x0000000000F91E00 + ff 0x0000000000F91D00 + folder 0x0000000000F94000 + atvdtv 0x0000000000F90600 + dvhs 0x0000000000F94100 + menu 0x0000000000F90800 + aspect 0x0000000000F90700 + zoom 0x0000000000F90400 + epg 0x0000000000F90B00 + mute 0x0000000000F90D00 + back 0x0000000000F90E00 + hd 0x0000000000F90F00 + red 0x0000000000F90500 + green 0x0000000000F90900 + yellow 0x0000000000F94200 + blue 0x0000000000F94300 + end codes + +end remote diff -ru --new-file lirc-0.7.0pre4-clean/setup-driver.sh lirc-0.7.0pre4-dvico/setup-driver.sh --- lirc-0.7.0pre4-clean/setup-driver.sh 2004-03-26 06:16:15.000000000 +1000 +++ lirc-0.7.0pre4-dvico/setup-driver.sh 2004-07-31 18:48:03.000000000 +1000 @@ -218,18 +218,20 @@ elif test "$1" = "8"; then dialog --clear --backtitle "$BACKTITLE" \ --title "Select your driver" \ - --menu "$CONFIG_DRIVER_TEXT" 10 74 3 \ + --menu "$CONFIG_DRIVER_TEXT" 10 74 4 \ \ 1 "ATI/NVidia/X10 RF Remote" \ - 2 "Home Electronics Tira USB device" \ - 3 "Windows Media Center Remotes" 2> $TEMP + 2 "DVICO FusionHDTV USB Remote" \ + 3 "Home Electronics Tira USB device" \ + 4 "Windows Media Center Remotes" 2> $TEMP if test "$?" = "0"; then { set `cat $TEMP` if false; then : elif test "$1" = "1"; then LIRC_DRIVER=atiusb; DRIVER_PARAMETER=none; DRIVER_PARAM_TYPE=none; - elif test "$1" = "2"; then LIRC_DRIVER=tira; DRIVER_PARAMETER=none; DRIVER_PARAM_TYPE=ttyUSB; - elif test "$1" = "3"; then LIRC_DRIVER=mceusb; DRIVER_PARAMETER=none; DRIVER_PARAM_TYPE=none; + elif test "$1" = "2"; then LIRC_DRIVER=dvico; DRIVER_PARAMETER=none; DRIVER_PARAM_TYPE=none; + elif test "$1" = "3"; then LIRC_DRIVER=tira; DRIVER_PARAMETER=none; DRIVER_PARAM_TYPE=none; + elif test "$1" = "4"; then LIRC_DRIVER=mceusb; DRIVER_PARAMETER=none; DRIVER_PARAM_TYPE=none; fi } else