Skip to content

Conversation

smanes0213
Copy link
Contributor

Reason for change : COM-RPC Implementation with fixes for -
getDeviceList does not return proper json tags in response.
Populating powerStatus instead of portNumber.
Added RequestAudioDevicePowerStatus API
Risks: Medium

 Reason for change : COM-RPC Implementation with fixes for -
                        getDeviceList does not return proper json tags in response.
                        Populating powerStatus instead of portNumber.
			Added RequestAudioDevicePowerStatus API

Signed-off-by: smanes0213 <[email protected]>
@smanes0213 smanes0213 requested a review from a team as a code owner July 31, 2025 10:45
#include "ccec/MessageEncoder.hpp"
#include "host.hpp"
#include "UtilsgetRFCConfig.h"

Copy link
Contributor

@apatel859 apatel859 Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Along with comparing the JSON RPC could you also share the custom build with DEV QA to perform the sanity check for HdmiCec feature and make sure no regression observed before we merge. Otherwise im ok with code changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have shared the custom build with QA waiting for the results from their side.

apatel859
apatel859 previously approved these changes Sep 16, 2025
device.osdName = HdmiCecSinkImplementation::_instance->deviceList[route[i]].m_osdName.toString().c_str();
device.vendorID = HdmiCecSinkImplementation::_instance->deviceList[route[i]].m_vendorID.toString().c_str();

paths.push_back(device);
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Variable copied when it could be moved

"device" is copied and then passed-by-reference as parameter to STL insertion function "std::vector<WPEFramework::Exchange::IHdmiCecSink::HdmiCecSinkActivePath, std::allocatorWPEFramework::Exchange::IHdmiCecSink::HdmiCecSinkActivePath >::push_back(std::vector<WPEFramework::Exchange::IHdmiCecSink::HdmiCecSinkActivePath, std::allocatorWPEFramework::Exchange::IHdmiCecSink::HdmiCecSinkActivePath >::value_type const &)", when it could be moved instead.

Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE

How to fix

Use "std::move(""device"")" instead of "device".

}


const void HdmiCecSinkImplementation::InitializeIARM()
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Parse warning

type qualifier on return type is meaningless

Low Impact, CWE-398
PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE

for (int i = 0; i < m_numofHdmiInput; i++){
HdmiPortMap hdmiPort((uint8_t)i);
LOGINFO(" Add to vector [%d] \n", i);
hdmiInputs.push_back(hdmiPort);
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Variable copied when it could be moved

"hdmiPort" is copied and then passed-by-reference as parameter to STL insertion function "std::vector<WPEFramework::Plugin::HdmiPortMap, std::allocatorWPEFramework::Plugin::HdmiPortMap >::push_back(std::vector<WPEFramework::Plugin::HdmiPortMap, std::allocatorWPEFramework::Plugin::HdmiPortMap >::value_type const &)", when it could be moved instead.

Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE

How to fix

Use "std::move(""hdmiPort"")" instead of "hdmiPort".

case NUMBER_9:
_instance->smConnection->sendTo(LogicalAddress(logicalAddress), MessageEncoder().encode(UserControlPressed(UICommand::UI_COMMAND_NUM_9)), 100);
break;
if(nullptr != _hdmiCecSink)
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Dereference before null check

Null-checking "this->_hdmiCecSink" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Medium Impact, CWE-476
REVERSE_INULL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only dereference the pointer if not NULL.

{
audiodescriptor.Add(descriptor);
}
HdmiCecSinkImplementation::_instance->Send_ShortAudioDescriptor_Event(audiodescriptor);
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Variable copied when it could be moved

"audiodescriptor" is passed-by-value as parameter to "WPEFramework::Core::JSON::ArrayTypeWPEFramework::Core::JSON::Variant::ArrayType(WPEFramework::Core::JSON::ArrayTypeWPEFramework::Core::JSON::Variant const &)", when it could be moved instead.

Low Impact, CWE-none
COPY_INSTEAD_OF_MOVE

How to fix

Use "std::move(""audiodescriptor"")" instead of "audiodescriptor".

, _registeredEventHandlers(false)
{
LOGWARN("Initlaizing HdmiCecSinkImplementation");
}
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Uninitialized scalar field

Non-static class member "cecEnableStatus" is not initialized in this constructor nor in any functions that it calls.

Medium Impact, CWE-457
UNINIT_CTOR

stopArc();
while(m_currentArcRoutingState != ARC_STATE_ARC_TERMINATED)
{
usleep(500000);
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Waiting while holding a lock

Call to "usleep" might sleep while holding lock "lock._M_device".

Medium Impact, CWE-667
SLEEP

}

std::unique_lock<std::mutex> lk(_instance->m_pollExitMutex);
if ( _instance->m_ThreadExitCV.wait_for(lk, std::chrono::milliseconds(_instance->m_sleepTime)) == std::cv_status::timeout )
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Data race condition

A wait is performed without a loop. If there is a spurious wakeup, the condition may not be satisfied. [Note: The source code implementation of the function has been overridden by a builtin model.]

Medium Impact, CWE-none
BAD_CHECK_OF_WAIT_COND

How to fix

Check the wait condition in a loop, with the lock held. The lock must not be released between the condition and the wait.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will resolve this as part of this ticket : https://ccp.sys.comcast.net/browse/RDKEMW-8431

}
msgProcessor = new HdmiCecSinkProcessor(*smConnection);
msgFrameListener = new HdmiCecSinkFrameListener(*msgProcessor);
if(smConnection)
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Dereference before null check

Null-checking "this->smConnection" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Medium Impact, CWE-476
REVERSE_INULL

PowerManagerInterfaceRef _powerManagerPlugin;
Core::Sink<PowerManagerNotification> _pwrMgrNotification;
bool _registeredEventHandlers;
const void InitializeIARM();
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Parse warning

type qualifier on return type is meaningless

Low Impact, CWE-398
PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE

{
stopArc();
while (m_currentArcRoutingState != ARC_STATE_ARC_TERMINATED) {
usleep(500000);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Waiting while holding a lock

Call to "usleep" might sleep while holding lock "lock._M_device".

Medium Impact, CWE-667
SLEEP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will resolve this as part of this ticket : https://ccp.sys.comcast.net/browse/RDKEMW-8431

, _registeredEventHandlers(false)
{
LOGWARN("Initializing HdmiCecSinkImplementation");
}
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity Issue - Uninitialized pointer field

Non-static class member "msgFrameListener" is not initialized in this constructor nor in any functions that it calls.

Medium Impact, CWE-457
UNINIT_CTOR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will resolve this as part of this ticket : https://ccp.sys.comcast.net/browse/RDKEMW-8431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants