- Drop upstream patches - Adds support for the CommandIR II userspace driverepel8
parent
46db3b83c3
commit
17c5bcd5c9
@ -1 +1,2 @@
|
||||
lirc-0.8.3.tar.bz2
|
||||
lirc-0.8.4pre1.tar.bz2
|
||||
|
@ -0,0 +1,175 @@
|
||||
|
||||
/****************************************************************************
|
||||
** hw_commandir.h **********************************************************
|
||||
****************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999 Christoph Bartelmus <lirc@bartelmus.de>
|
||||
* -- Original hw_default.h
|
||||
* Modified for CommandIR Transceivers, April-June 2008, Matthew Bodkin
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HW_COMMANDIR_H
|
||||
#define HW_COMMANDIR_H
|
||||
|
||||
#define RX_BUFFER_SIZE 1024
|
||||
#define TX_BUFFER_SIZE 1024
|
||||
#define TX_QUEUE 1
|
||||
#define RX_QUEUE 0
|
||||
#define MAX_COMMANDIRS 4
|
||||
#define MAX_COMMAND 8192
|
||||
|
||||
/* transmitter channel control */
|
||||
#define MAX_DEVICES 4
|
||||
#define MAX_CHANNELS 16
|
||||
#define DEVICE_CHANNELS 4
|
||||
#define MAX_MASK 0xffff
|
||||
#define MAX_SIGNALQ 100
|
||||
|
||||
/* CommandIR control codes */
|
||||
#define CHANNEL_EN_MASK 1
|
||||
#define FREQ_HEADER 2
|
||||
#define MCU_CTRL_SIZE 3
|
||||
#define TX_HEADER 7
|
||||
#define TX_HEADER_NEW 8
|
||||
/* New for CommandIR II */
|
||||
|
||||
#define READ_INPUTS 10
|
||||
#define PROC_SET 11
|
||||
#define INIT_FUNCTION 12
|
||||
#define RX_SELECT 13
|
||||
#define TX_COMMANDIR_II 14
|
||||
/* Internal to driver */
|
||||
#define TX_LIRC_T 15
|
||||
#define FREQ_HEADER_LIRC 16
|
||||
#define RXDECODE_HEADER_LIRC 17
|
||||
#define INIT_HEADER_LIRC 18
|
||||
#define DEINIT_HEADER_LIRC 19
|
||||
#define GET_VERSION 20
|
||||
|
||||
#define COMMANDIR_2_PULSE_MASK 0x8000
|
||||
#define COMMANDIR_2_OVERFLOW_MASK 0x4000
|
||||
|
||||
#define DEFAULT_PULSE_WIDTH 13
|
||||
|
||||
#define USB_CMDIR_VENDOR_ID 0x10c4
|
||||
#define USB_CMDIR_PRODUCT_ID 0x0003
|
||||
#define USB_CMDIR_MINOR_BASE 192
|
||||
|
||||
#define HW_COMMANDIR_MINI 1
|
||||
#define HW_COMMANDIR_2 2
|
||||
#define HW_COMMANDIR_UNKNOWN 127
|
||||
|
||||
#define MAX_HW_MINI_PACKET 64
|
||||
|
||||
// CommandIR has lots of buffer room, we don't need to poll constantly
|
||||
#define USB_TIMEOUT_MS 5000
|
||||
#define USB_TIMEOUT_US 1000
|
||||
#define WAIT_BETWEEN_READS_US 10000
|
||||
#define MAX_WAIT_BETWEEN_READS_US 5000000
|
||||
#define MIN_WAIT_BETWEEN_READS_US 5000
|
||||
|
||||
#define USB_MAX_BUSES 8
|
||||
#define USB_MAX_BUSDEV 127
|
||||
|
||||
#define RX_HEADER_DATA 0x01
|
||||
#define RX_HEADER_EVENTS 0x02
|
||||
#define RX_HEADER_TXAVAIL 0x03
|
||||
|
||||
|
||||
// We keep CommandIR's OPEN even on -deinit for speed and to monitor
|
||||
// Other non-LIRC events (plugin, suspend, etc)
|
||||
#define USB_KEEP_WARM 1
|
||||
|
||||
// CommandIR lircd.conf event driven code definitions
|
||||
#define LIRCCODE_GAP 125000
|
||||
#define JACK_PLUG_1 0x01
|
||||
#define JACK_PLUG_2 0x02
|
||||
#define JACK_PLUG_3 0x03
|
||||
#define JACK_PLUG_4 0x04
|
||||
#define JACK_PLUG_5 0x11
|
||||
#define JACK_PLUG_6 0x12
|
||||
#define JACK_PLUG_7 0x13
|
||||
#define JACK_PLUG_8 0x14
|
||||
#define JACK_PLUG_9 0x21
|
||||
#define JACK_PLUG_10 0x22
|
||||
#define JACK_PLUG_11 0x23
|
||||
#define JACK_PLUG_12 0x24
|
||||
#define JACK_PLUG_13 0x31
|
||||
#define JACK_PLUG_14 0x32
|
||||
#define JACK_PLUG_15 0x33
|
||||
#define JACK_PLUG_16 0x34
|
||||
|
||||
#define JACK_UNPLUG_1 0x05
|
||||
#define JACK_UNPLUG_2 0x06
|
||||
#define JACK_UNPLUG_3 0x07
|
||||
#define JACK_UNPLUG_4 0x08
|
||||
#define JACK_UNPLUG_5 0x15
|
||||
#define JACK_UNPLUG_6 0x16
|
||||
#define JACK_UNPLUG_7 0x17
|
||||
#define JACK_UNPLUG_8 0x18
|
||||
#define JACK_UNPLUG_9 0x25
|
||||
#define JACK_UNPLUG_10 0x26
|
||||
#define JACK_UNPLUG_11 0x27
|
||||
#define JACK_UNPLUG_12 0x28
|
||||
#define JACK_UNPLUG_13 0x35
|
||||
#define JACK_UNPLUG_14 0x36
|
||||
#define JACK_UNPLUG_15 0x37
|
||||
#define JACK_UNPLUG_16 0x38
|
||||
|
||||
#define SELECT_TX_INTERNAL 0x09
|
||||
#define SELECT_TX_ExTERNAL 0x0A
|
||||
|
||||
#define SELECT_TX_ON_1 0x0D
|
||||
#define SELECT_TX_ON_2 0x1D
|
||||
#define SELECT_TX_ON_3 0x2D
|
||||
#define SELECT_TX_ON_4 0x3D
|
||||
|
||||
#define JACK_PLUG_RX_1 0x0B
|
||||
#define JACK_UNPLUG_RX_1 0x0C
|
||||
#define JACK_PLUG_RX_2 0x1B
|
||||
#define JACK_UNPLUG_RX_2 0x1C
|
||||
#define JACK_PLUG_RX_3 0x2B
|
||||
#define JACK_UNPLUG_RX_3 0x2C
|
||||
#define JACK_PLUG_RX_4 0x3B
|
||||
#define JACK_UNPLUG_RX_4 0x3C
|
||||
|
||||
#define COMMANDIR_PLUG_1 0x41
|
||||
#define COMMANDIR_PLUG_2 0x42
|
||||
#define COMMANDIR_PLUG_3 0x43
|
||||
#define COMMANDIR_PLUG_4 0x44
|
||||
|
||||
#define COMMANDIR_UNPLUG_1 0x45
|
||||
#define COMMANDIR_UNPLUG_2 0x46
|
||||
#define COMMANDIR_UNPLUG_3 0x47
|
||||
#define COMMANDIR_UNPLUG_4 0x48
|
||||
|
||||
#define COMMANDIR_REORDERED 0x50
|
||||
#define COMMANDIR_READY 0x51
|
||||
#define COMMANDIR_STOPPED 0x52
|
||||
#define COMMANDIR_POLL_FASTER 0x53
|
||||
#define COMMANDIR_POLL_SLOWER 0x54
|
||||
|
||||
#define SETTRANSMITTERS_1 0xf0
|
||||
#define SETTRANSMITTERS_2 0xf1
|
||||
#define SETTRANSMITTERS_3 0xf2
|
||||
#define SETTRANSMITTERS_4 0xf3
|
||||
#define SETTRANSMITTERS_5 0xf4
|
||||
#define SETTRANSMITTERS_6 0xf5
|
||||
#define SETTRANSMITTERS_7 0xf6
|
||||
#define SETTRANSMITTERS_8 0xf7
|
||||
#define SETTRANSMITTERS_9 0xf8
|
||||
#define SETTRANSMITTERS_10 0xf9
|
||||
#define SETTRANSMITTERS_11 0xfa
|
||||
#define SETTRANSMITTERS_12 0xfb
|
||||
#define SETTRANSMITTERS_13 0xfc
|
||||
#define SETTRANSMITTERS_14 0xfd
|
||||
#define SETTRANSMITTERS_15 0xfe
|
||||
#define SETTRANSMITTERS_16 0xff
|
||||
|
||||
// What's in a returning data packet
|
||||
#define COMMANDIR_RX_EVENTS 0x02
|
||||
#define COMMANDIR_RX_DATA 0x01
|
||||
|
||||
|
||||
#endif
|
@ -1,341 +0,0 @@
|
||||
diff -Naurp lirc-0.8.3.orig/daemons/config_file.c lirc-0.8.3/daemons/config_file.c
|
||||
--- lirc-0.8.3.orig/daemons/config_file.c 2007-07-29 14:20:06.000000000 -0400
|
||||
+++ lirc-0.8.3/daemons/config_file.c 2008-05-12 18:02:32.000000000 -0400
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $Id: config_file.c,v 5.27 2007/07/29 18:20:06 lirc Exp $ */
|
||||
+/* $Id: config_file.c,v 5.28 2008/05/09 18:40:59 lirc Exp $ */
|
||||
|
||||
/****************************************************************************
|
||||
** config_file.c ***********************************************************
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+#include <libgen.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -32,9 +33,14 @@
|
||||
#include "config_file.h"
|
||||
|
||||
#define LINE_LEN 1024
|
||||
+#define MAX_INCLUDES 10
|
||||
|
||||
-int line;
|
||||
-int parse_error;
|
||||
+const char *whitespace = " \t";
|
||||
+
|
||||
+static int line;
|
||||
+static int parse_error;
|
||||
+
|
||||
+static struct ir_remote * read_config_recursive(FILE *f, const char *name, int depth);
|
||||
|
||||
void **init_void_array(struct void_array *ar,size_t chunk_size, size_t item_size)
|
||||
{
|
||||
@@ -643,7 +649,84 @@ struct ir_remote *sort_by_bit_count(stru
|
||||
return top;
|
||||
}
|
||||
|
||||
-struct ir_remote * read_config(FILE *f)
|
||||
+static const char *lirc_parse_include(char *s)
|
||||
+{
|
||||
+ char *last;
|
||||
+ size_t len;
|
||||
+
|
||||
+ len=strlen(s);
|
||||
+ if(len<2)
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ last = s+len-1;
|
||||
+ while(last > s && strchr(whitespace, *last) != NULL)
|
||||
+ {
|
||||
+ last--;
|
||||
+ }
|
||||
+ if(last <= s)
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if(*s!='"' && *s!='<')
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if(*s=='"' && *last!='"')
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ else if(*s=='<' && *last!='>')
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ *last = 0;
|
||||
+ memmove(s, s+1, len-2+1); /* terminating 0 is copied, and
|
||||
+ maybe more, but we don't care */
|
||||
+ return s;
|
||||
+}
|
||||
+
|
||||
+static const char *lirc_parse_relative(char *dst, size_t dst_size,
|
||||
+ const char *child, const char *current)
|
||||
+{
|
||||
+ char *dir;
|
||||
+ size_t dirlen;
|
||||
+
|
||||
+ if (!current)
|
||||
+ return child;
|
||||
+
|
||||
+ /* Not a relative path */
|
||||
+ if (*child == '/')
|
||||
+ return child;
|
||||
+
|
||||
+ if(strlen(current) >= dst_size)
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ strcpy(dst, current);
|
||||
+ dir = dirname(dst);
|
||||
+ dirlen = strlen(dir);
|
||||
+ if(dir != dst)
|
||||
+ {
|
||||
+ memmove(dst, dir, dirlen + 1);
|
||||
+ }
|
||||
+
|
||||
+ if(dirlen + 1 + strlen(child) + 1 > dst_size)
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ strcat(dst, "/");
|
||||
+ strcat(dst, child);
|
||||
+
|
||||
+ return dst;
|
||||
+}
|
||||
+
|
||||
+struct ir_remote * read_config(FILE *f, const char *name)
|
||||
+{
|
||||
+ return read_config_recursive(f, name, 0);
|
||||
+}
|
||||
+
|
||||
+static struct ir_remote * read_config_recursive(FILE *f, const char *name, int depth)
|
||||
{
|
||||
char buf[LINE_LEN+1], *key, *val, *val2;
|
||||
int len,argc;
|
||||
@@ -656,6 +739,7 @@ struct ir_remote * read_config(FILE *f)
|
||||
|
||||
line=0;
|
||||
parse_error=0;
|
||||
+ LOGPRINTF(2, "parsing '%s'", name);
|
||||
|
||||
while(fgets(buf,LINE_LEN,f)!=NULL)
|
||||
{
|
||||
@@ -683,14 +767,74 @@ struct ir_remote * read_config(FILE *f)
|
||||
if(buf[0]=='#'){
|
||||
continue;
|
||||
}
|
||||
- key=strtok(buf," \t");
|
||||
+ key=strtok(buf, whitespace);
|
||||
/* ignore empty lines */
|
||||
if(key==NULL) continue;
|
||||
- val=strtok(NULL, " \t");
|
||||
+ val=strtok(NULL, whitespace);
|
||||
if(val!=NULL){
|
||||
- val2=strtok(NULL, " \t");
|
||||
+ val2=strtok(NULL, whitespace);
|
||||
LOGPRINTF(3,"\"%s\" \"%s\"",key,val);
|
||||
- if (strcasecmp("begin",key)==0){
|
||||
+ if (strcasecmp("include",key)==0){
|
||||
+ FILE* childFile;
|
||||
+ const char *childName;
|
||||
+ const char *fullPath;
|
||||
+ char result[FILENAME_MAX+1];
|
||||
+
|
||||
+
|
||||
+ if (depth > MAX_INCLUDES) {
|
||||
+ logprintf(LOG_ERR,"error opening child file defined at %s:%d",name,line);
|
||||
+ logprintf(LOG_ERR,"too many files included");
|
||||
+ parse_error=-1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ childName = lirc_parse_include(val);
|
||||
+ if (!childName){
|
||||
+ logprintf(LOG_ERR,"error parsing child file value defined at line %d:",line);
|
||||
+ logprintf(LOG_ERR,"invalid quoting");
|
||||
+ parse_error=-1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ fullPath = lirc_parse_relative(result, sizeof(result), childName, name);
|
||||
+ if (!fullPath) {
|
||||
+ logprintf(LOG_ERR,"error composing relative file path defined at line %d:",line);
|
||||
+ logprintf(LOG_ERR,"resulting path too long");
|
||||
+ parse_error=-1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ childFile = fopen(fullPath, "r");
|
||||
+ if (childFile == NULL){
|
||||
+ logprintf(LOG_ERR,"error opening child file '%s' defined at line %d:",fullPath, line);
|
||||
+ logprintf(LOG_ERR,"ignoring this child file for now.");
|
||||
+ }
|
||||
+ else{
|
||||
+ int save_line = line;
|
||||
+
|
||||
+ if (!top_rem){
|
||||
+ /* create first remote */
|
||||
+ LOGPRINTF(2,"creating first remote");
|
||||
+ rem = read_config_recursive(childFile, fullPath, depth + 1);
|
||||
+ if(rem != (void *) -1 && rem != NULL) {
|
||||
+ top_rem = rem;
|
||||
+ } else {
|
||||
+ rem = NULL;
|
||||
+ }
|
||||
+ }else{
|
||||
+ /* create new remote */
|
||||
+ LOGPRINTF(2,"creating next remote");
|
||||
+ rem->next=read_config_recursive(childFile, fullPath, depth + 1);
|
||||
+ if(rem->next != (void *) -1 && rem->next != NULL) {
|
||||
+ rem=rem->next;
|
||||
+ } else {
|
||||
+ rem->next = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ fclose(childFile);
|
||||
+ line = save_line;
|
||||
+ }
|
||||
+ }else if (strcasecmp("begin",key)==0){
|
||||
if (strcasecmp("codes", val)==0){
|
||||
/* init codes mode */
|
||||
LOGPRINTF(2," begin codes");
|
||||
@@ -744,7 +888,7 @@ struct ir_remote * read_config(FILE *f)
|
||||
|
||||
if(val2[0]=='#') break; /* comment */
|
||||
node=defineNode(code, val2);
|
||||
- val2=strtok(NULL, " \t");
|
||||
+ val2=strtok(NULL, whitespace);
|
||||
}
|
||||
code->current=NULL;
|
||||
add_void_array(&codes_list, code);
|
||||
@@ -822,7 +966,7 @@ struct ir_remote * read_config(FILE *f)
|
||||
|
||||
if(val2[0]=='#') break; /* comment */
|
||||
node=defineNode(code, val2);
|
||||
- val2=strtok(NULL, " \t");
|
||||
+ val2=strtok(NULL, whitespace);
|
||||
}
|
||||
code->current=NULL;
|
||||
add_void_array(&codes_list, code);
|
||||
@@ -842,7 +986,7 @@ struct ir_remote * read_config(FILE *f)
|
||||
case ID_remote:
|
||||
argc=defineRemote(key, val, val2, rem);
|
||||
if(!parse_error && ((argc==1 && val2!=NULL) ||
|
||||
- (argc==2 && val2!=NULL && strtok(NULL," \t")!=NULL)))
|
||||
+ (argc==2 && val2!=NULL && strtok(NULL, whitespace)!=NULL)))
|
||||
{
|
||||
logprintf(LOG_WARNING,"garbage after '%s'"
|
||||
" token in line %d ignored",
|
||||
@@ -857,7 +1001,7 @@ struct ir_remote * read_config(FILE *f)
|
||||
|
||||
if(val2[0]=='#') break; /* comment */
|
||||
node=defineNode(code, val2);
|
||||
- val2=strtok(NULL, " \t");
|
||||
+ val2=strtok(NULL, whitespace);
|
||||
}
|
||||
code->current=NULL;
|
||||
add_void_array(&codes_list, code);
|
||||
@@ -905,7 +1049,7 @@ struct ir_remote * read_config(FILE *f)
|
||||
break;
|
||||
}
|
||||
}
|
||||
- while ((val=strtok(NULL," \t"))){
|
||||
+ while ((val=strtok(NULL, whitespace))){
|
||||
if (!addSignal(&signals, val)) break;
|
||||
}
|
||||
}
|
||||
@@ -950,7 +1094,15 @@ struct ir_remote * read_config(FILE *f)
|
||||
}
|
||||
}
|
||||
if (parse_error){
|
||||
+ static int print_error = 1;
|
||||
+
|
||||
+ if(print_error) {
|
||||
+ logprintf(LOG_ERR, "reading of file '%s' failed",
|
||||
+ name);
|
||||
+ print_error = 0;
|
||||
+ }
|
||||
free_config(top_rem);
|
||||
+ if(depth == 0) print_error = 1;
|
||||
return((void *) -1);
|
||||
}
|
||||
/* kick reverse flag */
|
||||
diff -Naurp lirc-0.8.3.orig/daemons/config_file.h lirc-0.8.3/daemons/config_file.h
|
||||
--- lirc-0.8.3.orig/daemons/config_file.h 2006-01-28 13:36:44.000000000 -0500
|
||||
+++ lirc-0.8.3/daemons/config_file.h 2008-05-12 18:02:22.000000000 -0400
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $Id: config_file.h,v 5.10 2006/01/28 18:36:44 lirc Exp $ */
|
||||
+/* $Id: config_file.h,v 5.11 2008/05/09 18:40:59 lirc Exp $ */
|
||||
|
||||
/****************************************************************************
|
||||
** config_file.h ***********************************************************
|
||||
@@ -86,7 +86,7 @@ int addSignal(struct void_array *signals
|
||||
struct ir_ncode * defineCode(char *key, char *val, struct ir_ncode *code);
|
||||
struct ir_code_node *defineNode(struct ir_ncode *code, const char *val);
|
||||
int defineRemote(char * key, char * val, char *val2, struct ir_remote *rem);
|
||||
-struct ir_remote *read_config(FILE *f);
|
||||
+struct ir_remote *read_config(FILE *f, const char *name);
|
||||
void free_config(struct ir_remote *remotes);
|
||||
|
||||
#endif
|
||||
diff -Naurp lirc-0.8.3.orig/daemons/irrecord.c lirc-0.8.3/daemons/irrecord.c
|
||||
--- lirc-0.8.3.orig/daemons/irrecord.c 2008-02-14 15:42:56.000000000 -0500
|
||||
+++ lirc-0.8.3/daemons/irrecord.c 2008-05-12 18:03:51.000000000 -0400
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $Id: irrecord.c,v 5.69 2008/02/14 20:42:56 lirc Exp $ */
|
||||
+/* $Id: irrecord.c,v 5.71 2008/05/09 18:40:59 lirc Exp $ */
|
||||
|
||||
/****************************************************************************
|
||||
** irrecord.c **************************************************************
|
||||
@@ -311,7 +311,7 @@ int main(int argc,char **argv)
|
||||
progname, filename, progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
- remotes=read_config(fin);
|
||||
+ remotes=read_config(fin, filename);
|
||||
fclose(fin);
|
||||
if(remotes==(void *) -1 || remotes==NULL)
|
||||
{
|
||||
@@ -748,7 +748,7 @@ int main(int argc,char **argv)
|
||||
if(hw.deinit_func) hw.deinit_func();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
- remotes=read_config(fin);
|
||||
+ remotes=read_config(fin,filename);
|
||||
fclose(fin);
|
||||
if(remotes==NULL)
|
||||
{
|
||||
diff -Naurp lirc-0.8.3.orig/daemons/lircd.c lirc-0.8.3/daemons/lircd.c
|
||||
--- lirc-0.8.3.orig/daemons/lircd.c 2008-03-30 10:53:06.000000000 -0400
|
||||
+++ lirc-0.8.3/daemons/lircd.c 2008-05-12 18:02:12.000000000 -0400
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $Id: lircd.c,v 5.76 2008/03/30 14:53:06 lirc Exp $ */
|
||||
+/* $Id: lircd.c,v 5.77 2008/05/09 18:40:59 lirc Exp $ */
|
||||
|
||||
/****************************************************************************
|
||||
** lircd.c *****************************************************************
|
||||
@@ -406,7 +406,7 @@ void config(void)
|
||||
logperror(LOG_ERR,NULL);
|
||||
return;
|
||||
}
|
||||
- config_remotes=read_config(fd);
|
||||
+ config_remotes=read_config(fd, configfile);
|
||||
fclose(fd);
|
||||
if(config_remotes==(void *) -1)
|
||||
{
|
||||
diff -Naurp lirc-0.8.3.orig/NEWS lirc-0.8.3/NEWS
|
||||
--- lirc-0.8.3.orig/NEWS 2008-05-12 17:59:40.000000000 -0400
|
||||
+++ lirc-0.8.3/NEWS 2008-05-12 18:05:04.000000000 -0400
|
||||
@@ -1,3 +1,6 @@
|
||||
+0.8.4-CVS: future
|
||||
+ * support for include directive in lircd.conf
|
||||
+
|
||||
0.8.3: 05/04/08
|
||||
* added support for Samsung USB IR Receiver (Robert Schedel)
|
||||
* added support for Soundgraph iMON IR/LCD (Dean Harding)
|
@ -1,58 +0,0 @@
|
||||
--- lirc/daemons/transmit.c 2007/07/29 18:20:13 5.27
|
||||
+++ lirc/daemons/transmit.c 2008/05/11 13:29:47 5.28
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $Id: transmit.c,v 5.27 2007/07/29 18:20:13 lirc Exp $ */
|
||||
+/* $Id: transmit.c,v 5.28 2008/05/11 13:29:47 lirc Exp $ */
|
||||
|
||||
/****************************************************************************
|
||||
** transmit.c **************************************************************
|
||||
@@ -116,6 +116,34 @@
|
||||
return(0);
|
||||
}
|
||||
|
||||
+static int check_send_buffer(void)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if (send_buffer.wptr == 0)
|
||||
+ {
|
||||
+ LOGPRINTF(1, "nothing to send");
|
||||
+ return(0);
|
||||
+ }
|
||||
+ for (i = 0; i < send_buffer.wptr; i++)
|
||||
+ {
|
||||
+ if(send_buffer.data[i] == 0)
|
||||
+ {
|
||||
+ if(i%2)
|
||||
+ {
|
||||
+ LOGPRINTF(1, "invalid space: %d", i);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ LOGPRINTF(1, "invalid pulse: %d", i);
|
||||
+ }
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
static inline void flush_send_buffer(void)
|
||||
{
|
||||
if(send_buffer.pendingp>0)
|
||||
@@ -500,5 +528,13 @@
|
||||
goto init_send_loop;
|
||||
}
|
||||
LOGPRINTF(3, "transmit buffer ready");
|
||||
- return(1);
|
||||
+ if(!check_send_buffer())
|
||||
+ {
|
||||
+ logprintf(LOG_ERR, "invalid send buffer");
|
||||
+ logprintf(LOG_ERR,
|
||||
+ "this remote configuration cannot be used "
|
||||
+ "to transmit");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue