RDK Documentation (Open Sourced RDK Components)

Description

Functions

static BusBus::getInstance (void)
 This function is used to create the instance of Bus class. More...
 
 Bus::Bus (void)
 This function is a constructor for the class Bus. It is used to starts the read and write thread which creates its instance. More...
 
void Bus::start (void)
 This function starts the threads and gets the instance for Bus. More...
 
void Bus::stop (void)
 This function stops the reader & writer threads and removes the instance for Bus. More...
 
 Bus::~Bus (void)
 This is a destructor for class BUS. This function initiates the closing of threads and the instance for Bus will be freed. More...
 
void Bus::Reader::run (void)
 This function is used to read CECFrame from the driver. This gets notified to the frameListener which is listening for frames in CEC bus. More...
 
void Bus::Reader::stop (bool block=true)
 This function is used to stop the reader to read frames from the bus. More...
 
void Bus::addFrameListener (FrameListener *listener)
 This function is used to add new listener for reading frames. More...
 
void Bus::removeFrameListener (FrameListener *listener)
 This function is used to remove the listener. More...
 
void Bus::Writer::run (void)
 This function is used to poll the bus for frame availability and it writes the CEC frame to the driver. More...
 
void Bus::Writer::stop (bool block=true)
 This function is used to stop the writer for polling the bus and writing to the driver. More...
 
void Bus::send (const CECFrame &frame, int timeout=0)
 This function is used to write the frame to the driver. If it fails, as it is a synchronous function, it retries every 250ms till the retry count lapse. More...
 
void Bus::sendAsync (const CECFrame &frame)
 This function is used to keep asynchronously sending the frame by keeping copy of cec frame in the queue of the driver. More...
 
void Bus::poll (const LogicalAddress &from, const LogicalAddress &to)
 This function is used to poll the logical address and returns the ACK or NACK received from other devices. If NACK then the device can use this logical address. More...
 
void Bus::ping (const LogicalAddress &from, const LogicalAddress &to)
 This function is used to ping devices, to know whether it present and returns the ACK or NACK received from other devices. If ACK is received, then the device is present. More...
 

Function Documentation

◆ getInstance()

CCEC_BEGIN_NAMESPACE Bus & Bus::getInstance ( void  )
static

This function is used to create the instance of Bus class.

Returns
instance Instance of the Bus class.

Definition at line 58 of file Bus.cpp.

◆ Bus()

Bus::Bus ( void  )
private

This function is a constructor for the class Bus. It is used to starts the read and write thread which creates its instance.

Returns
None

Definition at line 70 of file Bus.cpp.

◆ start()

void Bus::start ( void  )

This function starts the threads and gets the instance for Bus.

Returns
None

Definition at line 83 of file Bus.cpp.

◆ stop() [1/3]

void Bus::stop ( void  )

This function stops the reader & writer threads and removes the instance for Bus.

Returns
None

Definition at line 106 of file Bus.cpp.

◆ ~Bus()

Bus::~Bus ( void  )
private

This is a destructor for class BUS. This function initiates the closing of threads and the instance for Bus will be freed.

Returns
None

Definition at line 125 of file Bus.cpp.

◆ run() [1/2]

void Bus::Reader::run ( void  )
virtual

This function is used to read CECFrame from the driver. This gets notified to the frameListener which is listening for frames in CEC bus.

Returns
None

Implements CCEC_OSAL::Runnable.

Definition at line 142 of file Bus.cpp.

◆ stop() [2/3]

void Bus::Reader::stop ( bool  block = true)
virtual

This function is used to stop the reader to read frames from the bus.

Parameters
[in]blockState of Reader.
Returns
None

Implements CCEC_OSAL::Stoppable.

Definition at line 180 of file Bus.cpp.

◆ addFrameListener()

void Bus::addFrameListener ( FrameListener listener)

This function is used to add new listener for reading frames.

Parameters
[in]listenerStruct pointer for the addition of listener.
Returns
None

Definition at line 207 of file Bus.cpp.

◆ removeFrameListener()

void Bus::removeFrameListener ( FrameListener listener)

This function is used to remove the listener.

Parameters
[in]listenerStruct pointer of a listener which is to be removed.
Returns
None

Definition at line 222 of file Bus.cpp.

◆ run() [2/2]

void Bus::Writer::run ( void  )
virtual

This function is used to poll the bus for frame availability and it writes the CEC frame to the driver.

Returns
None

Implements CCEC_OSAL::Runnable.

Definition at line 237 of file Bus.cpp.

◆ stop() [3/3]

void Bus::Writer::stop ( bool  block = true)
virtual

This function is used to stop the writer for polling the bus and writing to the driver.

Parameters
[in]blockState of Writer.
Returns
None

Implements CCEC_OSAL::Stoppable.

Definition at line 294 of file Bus.cpp.

◆ send()

void Bus::send ( const CECFrame frame,
int  timeout = 0 
)

This function is used to write the frame to the driver. If it fails, as it is a synchronous function, it retries every 250ms till the retry count lapse.

Parameters
[in]frameCEC frame to be sent.
[in]timeoutTime period for retrying.
Returns
None

Definition at line 325 of file Bus.cpp.

◆ sendAsync()

void Bus::sendAsync ( const CECFrame frame)

This function is used to keep asynchronously sending the frame by keeping copy of cec frame in the queue of the driver.

Parameters
[in]frameCEC frame which need to be sent asynchronously.
Returns
None

Definition at line 373 of file Bus.cpp.

◆ poll()

void Bus::poll ( const LogicalAddress from,
const LogicalAddress to 
)

This function is used to poll the logical address and returns the ACK or NACK received from other devices. If NACK then the device can use this logical address.

Parameters
[in]Logicaladdress of initiator.
[in]Logicaladdress of follower.
Returns
throws exception if there is NACK

Definition at line 396 of file Bus.cpp.

◆ ping()

void Bus::ping ( const LogicalAddress from,
const LogicalAddress to 
)

This function is used to ping devices, to know whether it present and returns the ACK or NACK received from other devices. If ACK is received, then the device is present.

Parameters
[in]Logicaladdress of initiator.
[in]Logicaladdress of follower.
Returns
throws exception if there is NACK

Definition at line 423 of file Bus.cpp.