CEC : fix VtsHalTvCecV1_0TargetTest SendMessage test failed.

If CEC DUT is a TV device type,we should reset logical address to tv ,
 and then set message.initiator to tv.

Change-Id: If7f7b9ddce182e5de80c91a30c4ec18294459fbf
Signed-off-by: caijq <callen.cai@rock-chips.com>
This commit is contained in:
caijq 2023-04-13 10:45:56 +08:00 committed by jingqing cai
parent 683a0fc078
commit d936eb4589

View file

@ -127,7 +127,15 @@ TEST_P(HdmiCecTest, PhysicalAddress) {
TEST_P(HdmiCecTest, SendMessage) {
CecMessage message;
message.initiator = CecLogicalAddress::PLAYBACK_1;
if (hasDeviceType(CecDeviceType::TV))
{
hdmiCec->clearLogicalAddress();
Return<Result> result = hdmiCec->addLogicalAddress(CecLogicalAddress::TV);
EXPECT_EQ(result, Result::SUCCESS);
message.initiator = CecLogicalAddress::TV;
}
else
message.initiator = CecLogicalAddress::PLAYBACK_1;
message.destination = CecLogicalAddress::BROADCAST;
message.body.resize(1);
message.body[0] = 131;