LIRC libraries
LinuxInfraredRemoteControl
 All Classes Files Functions Variables Typedefs Enumerations Macros Modules Pages
lirc_client.c File Reference

(4fe27d8 2017-02-02 17:40:36 +0100)

Implements lirc_client.h. More...

#include <errno.h>
#include <libgen.h>
#include <limits.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/un.h>
#include <unistd.h>
#include "lirc_client.h"

Go to the source code of this file.

Macros

#define MAXPATHLEN   4096
 
#define logprintf(level, fmt, args...)   syslog(level, fmt, ## args)
 
#define LIRC_WARNING   LOG_WARNING
 
#define LIRC_DEBUG   LOG_DEBUG
 
#define LIRC_NOTICE   LOG_NOTICE
 
#define LIRC_ERROR   LOG_ERR
 
#define MAX_INCLUDES   10
 
#define LIRC_READ   255
 
#define LIRC_PACKET_SIZE   255
 
#define LIRC_TIMEOUT   3
 

Enumerations

enum  packet_state {
  P_BEGIN, P_MESSAGE, P_STATUS, P_DATA,
  P_N, P_DATA_N, P_END
}
 protocol state. More...
 

Functions

unsigned int lirc_flags (char *string)
 
int lirc_command_init (lirc_cmd_ctx *ctx, const char *fmt,...)
 Initiate a lirc_cmd_ctx to run a command. More...
 
void lirc_command_reply_to_stdout (lirc_cmd_ctx *ctx)
 Set command_ctx write_to_stdout flag. More...
 
int lirc_command_run (lirc_cmd_ctx *ctx, int fd)
 Run a command in non-blocking mode. More...
 
int lirc_init (const char *prog, int verbose)
 Initial setup: connect to lircd socket. More...
 
int lirc_deinit (void)
 Release resources allocated by lirc_init(), basically disconnect from socket.
 
int lirc_mode (char *token, char *token2, char **mode, struct lirc_config_entry **new_config, struct lirc_config_entry **first_config, struct lirc_config_entry **last_config, int(check)(char *s), const char *name, int line)
 
int lirc_identify (int sockfd)
 
int lirc_readconfig (const char *file, struct lirc_config **config, int(check)(char *s))
 Parse a lircrc configuration file. More...
 
int lirc_readconfig_only (const char *file, struct lirc_config **config, int(check)(char *s))
 Parse a lircrc configuration file without connecting to lircrcd. More...
 
void lirc_freeconfig (struct lirc_config *config)
 Deallocate an object retrieved using lirc_readconfig(). More...
 
char * lirc_ir2char (struct lirc_config *config, char *code)
 
int lirc_code2char (struct lirc_config *config, char *code, char **string)
 Translate a code string to an application string using .lircrc. More...
 
int lirc_code2charprog (struct lirc_config *config, char *code, char **string, char **prog)
 
char * lirc_nextir (void)
 
int lirc_nextcode (char **code)
 Get next available code from the lircd daemon. More...
 
size_t lirc_getsocketname (const char *id, char *buf, size_t size)
 Retrieve default lircrcd socket path. More...
 
const char * lirc_getmode (struct lirc_config *config)
 Get mode defined in lircrc. More...
 
const char * lirc_setmode (struct lirc_config *config, const char *mode)
 Set mode defined in lircrc. More...
 
int lirc_send_one (int fd, const char *remote, const char *keysym)
 Send keysym using given remote. More...
 
int lirc_simulate (int fd, const char *remote, const char *keysym, int scancode, int repeat)
 Send a simulated lirc event.This call might block for some time since it involves communication with lircd. More...
 
int lirc_get_local_socket (const char *path, int quiet)
 Return an opened and connected file descriptor to local lirc socket. More...
 
int lirc_get_remote_socket (const char *address, int port, int quiet)
 Return an opened and connected file descriptor to remote lirc socket. More...
 

Variables

char * prog
 

Detailed Description

Implements lirc_client.h.

Author
Christoph Bartelmus, Trent Piepho, Michal Svec

Definition in file lirc_client.c.

Enumeration Type Documentation

protocol state.

Definition at line 76 of file lirc_client.c.