Exemple #1
0
inline lirc_t get_next_pulse(lirc_t maxusec)
{
	lirc_t data;

	data=get_next_rec_buffer(maxusec);
	if(data==0) return(0);
	if(!is_pulse(data))
	{
		LOGPRINTF(2,"pulse expected");
		return(0);
	}
	return(data&(PULSE_MASK));
}
Exemple #2
0
inline lirc_t get_next_space(lirc_t maxusec)
{
	lirc_t data;

	data=get_next_rec_buffer(maxusec);
	if(data==0) return(0);
	if(!is_space(data))
	{
		LOGPRINTF(2,"space expected");
		return(0);
	}
	return(data);
}
inline int get_gap(struct ir_remote *remote, lirc_t gap)
{
	lirc_t data;

	logprintf(2, "sum: %d", rec_buffer.sum);
	data = get_next_rec_buffer(gap - gap * remote->eps / 100);
	if (data == 0)
		return (1);
	if (!is_space(data)) {
		logprintf(2, "space expected");
		return (0);
	}
	unget_rec_buffer(1);
	if (!expect_at_least(remote, data, gap)) {
		logprintf(1, "end of signal not found");
		return (0);
	}
	return (1);
}
Exemple #4
0
inline int get_gap(struct ir_remote *remote,lirc_t gap)
{
	lirc_t data;
	
	LOGPRINTF(2,"sum: %ld",rec_buffer.sum);
	data=get_next_rec_buffer(gap*(100-remote->eps)/100);
	if(data==0) return(1);
	if(!is_space(data))
	{
		LOGPRINTF(2,"space expected");
		return(0);
	}
	unget_rec_buffer(1);
	if(data<gap*(100-remote->eps)/100 &&
	   data<gap-remote->aeps)
	{
		LOGPRINTF(1,"end of signal not found");
		return(0);
	}
	return(1);	
}