diff --git a/server/drivers/irmanin.c b/server/drivers/irmanin.c index 012a0cd..0f13f62 100644 --- a/server/drivers/irmanin.c +++ b/server/drivers/irmanin.c @@ -1,5 +1,5 @@ /** \file server/drivers/irmanin.c - * LCDd \c irman input driver fora the IrMan IR remote control. + * LCDd \c irman input driver for the IrMan IR remote control. */ /* irmanin.c - test/demo of LIBIR's to interface with lcdproc (LCDd) */ @@ -47,26 +47,20 @@ CodeMap codemap[] = { { NULL, NULL } }; -////////////////////////////////////////////////////////////////////////// -////////////////////// Base "class" to derive from /////////////////////// -////////////////////////////////////////////////////////////////////////// - +/* vars for the server core */ MODULE_EXPORT char *api_version = API_VERSION; MODULE_EXPORT int stay_in_foreground = 0; MODULE_EXPORT int supports_multiple = 0; MODULE_EXPORT char *symbol_prefix = "irmanin_"; -//void sigterm(int sig) -//{ -// ir_free_commands(); -// ir_finish(); -// raise(sig); -//} -//////////////////////////////////////////////////////////// -// init() should set up any device-specific stuff, and -// point all the function pointers. +/** + * Initialize the driver. + * \param drvthis Pointer to driver structure. + * \retval 0 Success. + * \retval <0 Error. + */ MODULE_EXPORT int irmanin_init (Driver *drvthis) { @@ -141,6 +135,11 @@ irmanin_init (Driver *drvthis) return 1; // return success } + +/** + * Close the driver (do necessary clean-up). + * \param drvthis Pointer to driver structure. + */ MODULE_EXPORT void irmanin_close (Driver *drvthis) { @@ -154,11 +153,12 @@ irmanin_close (Driver *drvthis) ir_finish(); } -////////////////////////////////////////////////////////////////////// -// Tries to read a LCDproc character string from an input device... -// -// Return NULL for "nothing available". -// +/** + * Get key from the device. + * \param drvthis Pointer to driver structure. + * \return String representation of the key; + * \c NULL if nothing available / unmapped key. + */ MODULE_EXPORT const char * irmanin_get_key (Driver *drvthis) { diff --git a/server/drivers/irmanin.h b/server/drivers/irmanin.h index 80ad82f..38745d8 100644 --- a/server/drivers/irmanin.h +++ b/server/drivers/irmanin.h @@ -1,16 +1,17 @@ #ifndef LCD_IRMANIN__H #define LCD_IRMANIN_H +/** mapping between IrMan code names and LCDd key names */ typedef struct _codemap { - const char *irman; - const char *lcdproc; + const char *irman; /**< IrMan code name */ + const char *lcdproc; /**< LCDpüroc key name */ } CodeMap; /** private data for the \c irman driver */ typedef struct irmanin_private_data { - char device[256]; - char config[256]; - char *portname; + char device[256]; /**< IrMan device name */ + char config[256]; /**< IrMan config file */ + char *portname; /**< IrMan port name */ } PrivateData; MODULE_EXPORT int irmanin_init (Driver *drvthis); diff --git a/server/drivers/lircin.c b/server/drivers/lircin.c index f68f354..d05db26 100644 --- a/server/drivers/lircin.c +++ b/server/drivers/lircin.c @@ -51,21 +51,25 @@ /** private data for the \c lirc driver */ typedef struct lircin_private_data { - char *lircrc; - char *prog; - int lircin_fd; - struct lirc_config *lircin_irconfig; + char *lircrc; /**< path/name of the LIRC config file */ + char *prog; /**< program identifier in LIRC config file */ + int lircin_fd; /**< LIRC socket file handle */ + struct lirc_config *lircin_irconfig; /**< LIRC config */ } PrivateData; +/* vars for the server core */ MODULE_EXPORT char *api_version = API_VERSION; MODULE_EXPORT int stay_in_foreground = 0; MODULE_EXPORT int supports_multiple = 0; MODULE_EXPORT char *symbol_prefix = "lircin_"; -/*********************************************************** - * init() should set up any device-specific stuff, and - * point all the function pointers. + +/** + * Initialize the driver. + * \param drvthis Pointer to driver structure. + * \retval 0 Success. + * \retval <0 Error. */ MODULE_EXPORT int lircin_init (Driver *drvthis) @@ -155,8 +159,10 @@ lircin_init (Driver *drvthis) return 0; } -/********************************************************************* - * Closes the device + +/** + * Close the driver (do necessary clean-up). + * \param drvthis Pointer to driver structure. */ MODULE_EXPORT void lircin_close (Driver *drvthis) @@ -187,10 +193,12 @@ lircin_close (Driver *drvthis) drvthis->store_private_ptr(drvthis, NULL); } -/********************************************************************* - * Tries to read a character from an input device... - * - * Return NULL for "nothing available". + +/** + * Get key from the device. + * \param drvthis Pointer to driver structure. + * \return String representation of the key; + * \c NULL if nothing available / unmapped key. */ MODULE_EXPORT const char * lircin_get_key (Driver *drvthis)