Loading...
Searching...
No Matches
lirc_client.c File Reference

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.
void | lirc_command_reply_to_stdout (lirc_cmd_ctx *ctx)
| Set command_ctx write_to_stdout flag.
int | lirc_command_run (lirc_cmd_ctx *ctx, int fd)
| Run a command in non-blocking mode.
int | lirc_init (const char *prog, int verbose)
| Initial setup: connect to lircd socket.
int | lirc_deinit (void)
| Release resources allocated by lirc_init(), basically disconnect from socket.
void | lirc_set_verbose (int v)
| Dynamically change the verbose level defined by lirc_init().
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.
int | lirc_readconfig_only (const char *file, struct lirc_config **config, int(check)(char *s))
| Parse a lircrc configuration file without connecting to lircrcd.
void | lirc_freeconfig (struct lirc_config *config)
| Deallocate an object retrieved using lirc_readconfig().
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.
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.
size_t | lirc_getsocketname (const char *id, char *buf, size_t size)
| Retrieve default lircrcd socket path.
const char * | lirc_getmode (struct lirc_config *config)
| Get mode defined in lircrc.
const char * | lirc_setmode (struct lirc_config *config, const char *mode)
| Set mode defined in lircrc.
int | lirc_send_one (int fd, const char *remote, const char *keysym)
| Send keysym using given remote.
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.
int | lirc_get_local_socket (const char *path, int quiet)
| Return an opened and connected file descriptor to local lirc socket.
int | lirc_get_remote_socket (const char *address, int port, int quiet)
| Return an opened and connected file descriptor to remote lirc socket.

## Variables

char * | prog

## Detailed Description

Implements lirc_client.h.

Author
  Christoph Bartelmus, Trent Piepho, Michal Svec

Definition in file lirc_client.c.

## Macro Definition Documentation

## LIRC_DEBUG

#define LIRC_DEBUG LOG_DEBUG

Definition at line 55 of file lirc_client.c.

## LIRC_ERROR

#define LIRC_ERROR LOG_ERR

Definition at line 57 of file lirc_client.c.

## LIRC_NOTICE

#define LIRC_NOTICE LOG_NOTICE

Definition at line 56 of file lirc_client.c.

## LIRC_PACKET_SIZE

#define LIRC_PACKET_SIZE 255

Definition at line 62 of file lirc_client.c.

## LIRC_READ

#define LIRC_READ 255

Definition at line 61 of file lirc_client.c.

## LIRC_TIMEOUT

#define LIRC_TIMEOUT 3

Definition at line 64 of file lirc_client.c.

## LIRC_WARNING

#define LIRC_WARNING LOG_WARNING

Definition at line 54 of file lirc_client.c.

## logprintf

#define logprintf | ( |  | level,
|  |  | fmt,
|  |  | args ...
| ) |  | syslog(level, fmt, ## args)

Definition at line 53 of file lirc_client.c.

## MAX_INCLUDES

#define MAX_INCLUDES 10

Definition at line 60 of file lirc_client.c.

## MAXPATHLEN

#define MAXPATHLEN 4096

Definition at line 45 of file lirc_client.c.

## Enumeration Type Documentation

## packet_state

enum packet_state

protocol state.

Definition at line 76 of file lirc_client.c.

## Function Documentation

## lirc_flags()

unsigned int lirc_flags | ( | char * | string | ) |

Definition at line 735 of file lirc_client.c.

## lirc_identify()

int lirc_identify | ( | int | sockfd | ) |

Definition at line 1431 of file lirc_client.c.

## lirc_mode()

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
| ) |  |

Definition at line 589 of file lirc_client.c.

## Variable Documentation

## prog

char* prog

Definition at line 99 of file lirc_client.c.