F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Drv::LinuxUartDriver Class Reference

#include <Drv/LinuxUartDriver/LinuxUartDriver.hpp>

Inheritance diagram for Drv::LinuxUartDriver:
Drv::LinuxUartDriverComponentBase Fw::PassiveComponentBase Fw::ObjBase

Public Types

enum  UartBaudRate {
  BAUD_9600 =9600 , BAUD_19200 =19200 , BAUD_38400 =38400 , BAUD_57600 =57600 ,
  BAUD_115K =115200 , BAUD_230K =230400
}
 Configure UART parameters. More...
 
enum  UartFlowControl { NO_FLOW , HW_FLOW }
 
enum  UartParity { PARITY_NONE , PARITY_ODD , PARITY_EVEN }
 

Public Member Functions

 LinuxUartDriver (const char *const compName)
 
void init (const NATIVE_INT_TYPE instance=0)
 
bool open (const char *const device, UartBaudRate baud, UartFlowControl fc, UartParity parity, U32 allocationSize)
 
void start (Os::Task::ParamType priority=Os::Task::TASK_DEFAULT, Os::Task::ParamType stackSize=Os::Task::TASK_DEFAULT, Os::Task::ParamType cpuAffinity=Os::Task::TASK_DEFAULT)
 
void quitReadThread ()
 Quit thread. More...
 
Os::Task::Status join ()
 Join thread. More...
 
 ~LinuxUartDriver ()
 
- Public Member Functions inherited from Drv::LinuxUartDriverComponentBase
void init (FwEnumStoreType instance=0)
 Initialize LinuxUartDriverComponentBase object. More...
 
Drv::InputByteStreamSendPortget_send_InputPort (FwIndexType portNum)
 
void set_Log_OutputPort (FwIndexType portNum, Fw::InputLogPort *port)
 Connect port to Log[portNum]. More...
 
void set_Time_OutputPort (FwIndexType portNum, Fw::InputTimePort *port)
 Connect port to Time[portNum]. More...
 
void set_Tlm_OutputPort (FwIndexType portNum, Fw::InputTlmPort *port)
 Connect port to Tlm[portNum]. More...
 
void set_allocate_OutputPort (FwIndexType portNum, Fw::InputBufferGetPort *port)
 Connect port to allocate[portNum]. More...
 
void set_deallocate_OutputPort (FwIndexType portNum, Fw::InputBufferSendPort *port)
 Connect port to deallocate[portNum]. More...
 
void set_ready_OutputPort (FwIndexType portNum, Drv::InputByteStreamReadyPort *port)
 Connect port to ready[portNum]. More...
 
void set_recv_OutputPort (FwIndexType portNum, Drv::InputByteStreamRecvPort *port)
 Connect port to recv[portNum]. More...
 
- Public Member Functions inherited from Fw::PassiveComponentBase
void setIdBase (const U32)
 Set the ID base. More...
 
U32 getIdBase () const
 

Additional Inherited Members

- Protected Types inherited from Drv::LinuxUartDriverComponentBase
enum  { NUM_SEND_INPUT_PORTS = 1 }
 Enumerations for numbers of typed input ports. More...
 
enum  { NUM_LOG_OUTPUT_PORTS = 1 , NUM_LOGTEXT_OUTPUT_PORTS = 1 , NUM_TIME_OUTPUT_PORTS = 1 , NUM_TLM_OUTPUT_PORTS = 1 }
 Enumerations for numbers of special output ports. More...
 
enum  { NUM_ALLOCATE_OUTPUT_PORTS = 1 , NUM_DEALLOCATE_OUTPUT_PORTS = 1 , NUM_READY_OUTPUT_PORTS = 1 , NUM_RECV_OUTPUT_PORTS = 1 }
 Enumerations for numbers of typed output ports. More...
 
enum  {
  EVENTID_OPENERROR = 0x0 , EVENTID_CONFIGERROR = 0x1 , EVENTID_WRITEERROR = 0x2 , EVENTID_READERROR = 0x3 ,
  EVENTID_PORTOPENED = 0x4 , EVENTID_NOBUFFERS = 0x5 , EVENTID_BUFFERTOOSMALL = 0x6
}
 Event IDs. More...
 
enum  { EVENTID_WRITEERROR_THROTTLE = 5 , EVENTID_READERROR_THROTTLE = 5 , EVENTID_NOBUFFERS_THROTTLE = 20 }
 Event throttle values: sets initial value of countdown variables. More...
 
enum  { CHANNELID_BYTESSENT = 0x0 , CHANNELID_BYTESRECV = 0x1 }
 Channel IDs. More...
 
- Protected Member Functions inherited from Drv::LinuxUartDriverComponentBase
 LinuxUartDriverComponentBase (const char *compName="")
 Construct LinuxUartDriverComponentBase object. More...
 
virtual ~LinuxUartDriverComponentBase ()
 Destroy LinuxUartDriverComponentBase object. More...
 
FwIndexType getNum_send_InputPorts () const
 
FwIndexType getNum_Log_OutputPorts () const
 
FwIndexType getNum_Time_OutputPorts () const
 
FwIndexType getNum_Tlm_OutputPorts () const
 
FwIndexType getNum_allocate_OutputPorts () const
 
FwIndexType getNum_deallocate_OutputPorts () const
 
FwIndexType getNum_ready_OutputPorts () const
 
FwIndexType getNum_recv_OutputPorts () const
 
bool isConnected_Log_OutputPort (FwIndexType portNum)
 
bool isConnected_Time_OutputPort (FwIndexType portNum)
 
bool isConnected_Tlm_OutputPort (FwIndexType portNum)
 
bool isConnected_allocate_OutputPort (FwIndexType portNum)
 
bool isConnected_deallocate_OutputPort (FwIndexType portNum)
 
bool isConnected_ready_OutputPort (FwIndexType portNum)
 
bool isConnected_recv_OutputPort (FwIndexType portNum)
 
Drv::SendStatus send_handlerBase (FwIndexType portNum, Fw::Buffer &sendBuffer)
 Handler base-class function for input port send. More...
 
Fw::Buffer allocate_out (FwIndexType portNum, U32 size)
 Invoke output port allocate. More...
 
void deallocate_out (FwIndexType portNum, Fw::Buffer &fwBuffer)
 Invoke output port deallocate. More...
 
void ready_out (FwIndexType portNum)
 Invoke output port ready. More...
 
void recv_out (FwIndexType portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
 Invoke output port recv. More...
 
void log_WARNING_HI_OpenError (const Fw::StringBase &device, I32 error, const Fw::StringBase &name)
 
void log_WARNING_HI_ConfigError (const Fw::StringBase &device, I32 error)
 
void log_WARNING_HI_WriteError (const Fw::StringBase &device, I32 error)
 
void log_WARNING_HI_ReadError (const Fw::StringBase &device, I32 error)
 
void log_ACTIVITY_HI_PortOpened (const Fw::StringBase &device)
 
void log_WARNING_HI_NoBuffers (const Fw::StringBase &device)
 
void log_WARNING_HI_BufferTooSmall (const Fw::StringBase &device, U32 size, U32 needed)
 
void log_WARNING_HI_WriteError_ThrottleClear ()
 Reset throttle value for WriteError. More...
 
void log_WARNING_HI_ReadError_ThrottleClear ()
 Reset throttle value for ReadError. More...
 
void log_WARNING_HI_NoBuffers_ThrottleClear ()
 Reset throttle value for NoBuffers. More...
 
void tlmWrite_BytesSent (U32 arg, Fw::Time _tlmTime=Fw::Time())
 
void tlmWrite_BytesRecv (U32 arg, Fw::Time _tlmTime=Fw::Time())
 
Fw::Time getTime ()
 
virtual void lock ()
 Lock the guarded mutex. More...
 
virtual void unLock ()
 Unlock the guarded mutex. More...
 
- Protected Member Functions inherited from Fw::PassiveComponentBase
 PassiveComponentBase (const char *name)
 Named constructor. More...
 
virtual ~PassiveComponentBase ()
 Destructor. More...
 
void init (NATIVE_INT_TYPE instance)
 Initialization function. More...
 
NATIVE_INT_TYPE getInstance () const
 
- Protected Member Functions inherited from Fw::ObjBase
 ObjBase (const char *name)
 ObjBase constructor. More...
 
virtual ~ObjBase ()
 Destructor. More...
 
void init ()
 Object initializer. More...
 

Detailed Description

Definition at line 24 of file LinuxUartDriver.hpp.

Member Enumeration Documentation

◆ UartBaudRate

Configure UART parameters.

Enumerator
BAUD_9600 
BAUD_19200 
BAUD_38400 
BAUD_57600 
BAUD_115K 
BAUD_230K 

Definition at line 41 of file LinuxUartDriver.hpp.

◆ UartFlowControl

Enumerator
NO_FLOW 
HW_FLOW 

Definition at line 70 of file LinuxUartDriver.hpp.

◆ UartParity

Enumerator
PARITY_NONE 
PARITY_ODD 
PARITY_EVEN 

Definition at line 72 of file LinuxUartDriver.hpp.

Constructor & Destructor Documentation

◆ LinuxUartDriver()

Drv::LinuxUartDriver::LinuxUartDriver ( const char *const  compName)

Construct object LinuxUartDriver

Parameters
compNameThe component name

Definition at line 34 of file LinuxUartDriver.cpp.

◆ ~LinuxUartDriver()

Drv::LinuxUartDriver::~LinuxUartDriver ( )

Destroy object LinuxUartDriver

Definition at line 309 of file LinuxUartDriver.cpp.

Member Function Documentation

◆ init()

void Drv::LinuxUartDriver::init ( const NATIVE_INT_TYPE  instance = 0)

Initialize object LinuxUartDriver

Parameters
instanceThe instance number

Definition at line 38 of file LinuxUartDriver.cpp.

◆ join()

Os::Task::Status Drv::LinuxUartDriver::join ( )

Join thread.

Definition at line 403 of file LinuxUartDriver.cpp.

◆ open()

bool Drv::LinuxUartDriver::open ( const char *const  device,
UartBaudRate  baud,
UartFlowControl  fc,
UartParity  parity,
U32  allocationSize 
)

Definition at line 42 of file LinuxUartDriver.cpp.

◆ quitReadThread()

void Drv::LinuxUartDriver::quitReadThread ( )

Quit thread.

Definition at line 399 of file LinuxUartDriver.cpp.

◆ start()

void Drv::LinuxUartDriver::start ( Os::Task::ParamType  priority = Os::Task::TASK_DEFAULT,
Os::Task::ParamType  stackSize = Os::Task::TASK_DEFAULT,
Os::Task::ParamType  cpuAffinity = Os::Task::TASK_DEFAULT 
)

start the serial poll thread. buffSize is the max receive buffer size

Definition at line 392 of file LinuxUartDriver.cpp.


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