DevSlashLirc
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
LircDevice Class Referenceabstract

This abstract class contains the common functionality of the derived classes. More...

#include <LircDevice.h>

Inheritance diagram for LircDevice:
Inheritance graph
[legend]

Public Member Functions

bool close ()
 
virtual ~LircDevice ()
 
bool isValid () const
 
milliseconds_t getBeginTimeout () const
 
void setBeginTimeout (milliseconds_t timeout)
 
virtual void report (std::ostream &stream=std::cout) const
 Prints a listing of the properties implemented on the stream supplied. More...
 
virtual bool isMode2 () const =0
 
virtual bool isLircCode () const =0
 
bool canSend () const
 
bool canSetTransmitterMask () const
 
bool canRec () const
 
bool canSetRecTimeout () const
 
bool canSendPulse () const
 
bool canSendLircCode () const
 
bool canRecMode2 () const
 
bool canRecLircCode () const
 
unsigned getNumberTransmitters () const
 Return the number of transmitters as reported from the device. More...
 
int setTransmitterMask (uint32_t mask)
 Enable the set of transmitters specified in val, which contains a bit mask where each enabled transmitter is a 1. More...
 
int setRecTimeout (int arg)
 Set the integer value for IR inactivity timeout (microseconds). More...
 
int setRecTimeoutReports (bool enable)
 Enable or disable timeout packages. More...
 

Static Public Attributes

static const char * version = "LircDevice " VERSION
 
static const char * defaultFilename = "/dev/lirc0"
 
static const milliseconds_t defaultBeginTimeout = 5000U
 
static const uint32_t INVALID = UINT32_MAX
 

Protected Member Functions

void report (const char *name, bool value, std::ostream &stream) const
 
bool reportValidity (std::ostream &stream=std::cout) const
 
int ioctl (uint32_t cmd, uint32_t arg)
 
bool canDo (uint32_t mask) const
 
 LircDevice (const char *path=defaultFilename, milliseconds_t beginTimeout=defaultBeginTimeout)
 
 LircDevice (const LircDevice &orig)
 
virtual bool open ()
 

Protected Attributes

bool valid
 
const char * fileName
 
int fileDescriptor
 
unsigned numberTransmitters
 
uint32_t recordingMode
 
uint32_t features
 
milliseconds_t beginTimeout
 

Static Protected Attributes

static const bool longReport = false
 Flag indicating how to format reports. More...
 

Detailed Description

This abstract class contains the common functionality of the derived classes.

It opens a file system device, per default /dev/lirc0, as described in lirc(4).

Definition at line 24 of file LircDevice.h.

Constructor & Destructor Documentation

◆ LircDevice() [1/2]

LircDevice::LircDevice ( const char *  path = defaultFilename,
milliseconds_t  beginTimeout = defaultBeginTimeout 
)
protected

Definition at line 18 of file LircDevice.cpp.

◆ LircDevice() [2/2]

LircDevice::LircDevice ( const LircDevice orig)
protected

Definition at line 68 of file LircDevice.cpp.

◆ ~LircDevice()

LircDevice::~LircDevice ( )
virtual

Definition at line 78 of file LircDevice.cpp.

Member Function Documentation

◆ canDo()

bool LircDevice::canDo ( uint32_t  mask) const
inlineprotected

Definition at line 42 of file LircDevice.h.

◆ canRec()

bool LircDevice::canRec ( ) const
inline

Definition at line 78 of file LircDevice.h.

◆ canRecLircCode()

bool LircDevice::canRecLircCode ( ) const
inline

Definition at line 85 of file LircDevice.h.

◆ canRecMode2()

bool LircDevice::canRecMode2 ( ) const
inline

Definition at line 84 of file LircDevice.h.

◆ canSend()

bool LircDevice::canSend ( ) const
inline

Definition at line 76 of file LircDevice.h.

◆ canSendLircCode()

bool LircDevice::canSendLircCode ( ) const
inline

Definition at line 83 of file LircDevice.h.

◆ canSendPulse()

bool LircDevice::canSendPulse ( ) const
inline

Definition at line 82 of file LircDevice.h.

◆ canSetRecTimeout()

bool LircDevice::canSetRecTimeout ( ) const
inline

Definition at line 79 of file LircDevice.h.

◆ canSetTransmitterMask()

bool LircDevice::canSetTransmitterMask ( ) const
inline

Definition at line 77 of file LircDevice.h.

◆ close()

bool LircDevice::close ( )

Definition at line 82 of file LircDevice.cpp.

◆ getBeginTimeout()

milliseconds_t LircDevice::getBeginTimeout ( ) const
inline

Definition at line 59 of file LircDevice.h.

◆ getNumberTransmitters()

unsigned LircDevice::getNumberTransmitters ( ) const
inline

Return the number of transmitters as reported from the device.

Returns
Number transmitters.

Definition at line 92 of file LircDevice.h.

◆ ioctl()

int LircDevice::ioctl ( uint32_t  cmd,
uint32_t  arg 
)
protected

Definition at line 98 of file LircDevice.cpp.

◆ isLircCode()

virtual bool LircDevice::isLircCode ( ) const
pure virtual

Implemented in Mode2LircDevice, and LircCodeLircDevice.

◆ isMode2()

virtual bool LircDevice::isMode2 ( ) const
pure virtual

Implemented in Mode2LircDevice, and LircCodeLircDevice.

◆ isValid()

bool LircDevice::isValid ( ) const
inline

Definition at line 57 of file LircDevice.h.

◆ open()

bool LircDevice::open ( )
protectedvirtual

Reimplemented in Mode2LircDevice, and LircCodeLircDevice.

Definition at line 21 of file LircDevice.cpp.

◆ report() [1/2]

void LircDevice::report ( const char *  name,
bool  value,
std::ostream &  stream 
) const
protected

Definition at line 102 of file LircDevice.cpp.

◆ report() [2/2]

void LircDevice::report ( std::ostream &  stream = std::cout) const
virtual

Prints a listing of the properties implemented on the stream supplied.

Parameters
stream

Reimplemented in Mode2LircDevice, and LircCodeLircDevice.

Definition at line 110 of file LircDevice.cpp.

◆ reportValidity()

bool LircDevice::reportValidity ( std::ostream &  stream = std::cout) const
protected

Definition at line 138 of file LircDevice.cpp.

◆ setBeginTimeout()

void LircDevice::setBeginTimeout ( milliseconds_t  timeout)
inline

Definition at line 63 of file LircDevice.h.

◆ setRecTimeout()

int LircDevice::setRecTimeout ( int  arg)
inline

Set the integer value for IR inactivity timeout (microseconds).

To be accepted, the value must be within the limits defined by LIRC_GET_MIN_TIMEOUT and LIRC_GET_MAX_TIMEOUT. A value of 0 (if supported by the hardware) disables all hardware timeouts and data should be reported as soon as possible. If the exact value cannot be set, then the next possible value greater than the given value should be set.

Definition at line 116 of file LircDevice.h.

◆ setRecTimeoutReports()

int LircDevice::setRecTimeoutReports ( bool  enable)
inline

Enable or disable timeout packages.

By default, timeout reports should be turned off.

Definition at line 124 of file LircDevice.h.

◆ setTransmitterMask()

int LircDevice::setTransmitterMask ( uint32_t  mask)
inline

Enable the set of transmitters specified in val, which contains a bit mask where each enabled transmitter is a 1.

The first transmitter is encoded by the least significant bit, and so on. When an invalid bit mask is given, for example a bit is set even though the device does not have so many transmitters, this operation returns the number of available transmitters and does nothing otherwise.

Definition at line 103 of file LircDevice.h.

Member Data Documentation

◆ beginTimeout

milliseconds_t LircDevice::beginTimeout
protected

Definition at line 35 of file LircDevice.h.

◆ defaultBeginTimeout

const milliseconds_t LircDevice::defaultBeginTimeout = 5000U
static

Definition at line 52 of file LircDevice.h.

◆ defaultFilename

const char * LircDevice::defaultFilename = "/dev/lirc0"
static

Definition at line 51 of file LircDevice.h.

◆ features

uint32_t LircDevice::features
protected

Definition at line 34 of file LircDevice.h.

◆ fileDescriptor

int LircDevice::fileDescriptor
protected

Definition at line 31 of file LircDevice.h.

◆ fileName

const char* LircDevice::fileName
protected

Definition at line 30 of file LircDevice.h.

◆ INVALID

const uint32_t LircDevice::INVALID = UINT32_MAX
static

Definition at line 53 of file LircDevice.h.

◆ longReport

const bool LircDevice::longReport = false
staticprotected

Flag indicating how to format reports.

Definition at line 27 of file LircDevice.h.

◆ numberTransmitters

unsigned LircDevice::numberTransmitters
protected

Definition at line 32 of file LircDevice.h.

◆ recordingMode

uint32_t LircDevice::recordingMode
protected

Definition at line 33 of file LircDevice.h.

◆ valid

bool LircDevice::valid
protected

Definition at line 29 of file LircDevice.h.

◆ version

const char * LircDevice::version = "LircDevice " VERSION
static

Definition at line 50 of file LircDevice.h.


The documentation for this class was generated from the following files: