diff --git a/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp b/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp index 4d2698dbe..402bda600 100644 --- a/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp +++ b/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp @@ -121,6 +121,15 @@ void RunAllTests() { runTest(ManageSDKTest::SendResponseMessageToPinChallengeProvider, "SendResponseMessageToPinChallengeProvider"); runTest(ManageSDKTest::SendErrorMessageToPinChallengeProvider, "SendErrorMessageToPinChallengeProvider"); + runTest(ManageSDKTest::GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged, "GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged"); + runTest(ManageSDKTest::GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged, "GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged"); + + runTest(ManageSDKTest::GetAutoLowLatencyModeCapable, "GetAutoLowLatencyModeCapable"); + runTest(ManageSDKTest::SetAutoLowLatencyModeCapable, "SetAutoLowLatencyModeCapable"); + runTest(ManageSDKTest::GetEdidVersion, "GetEdidVersion"); + runTest(ManageSDKTest::SetEdidVersion, "SetEdidVersion"); + runTest(ManageSDKTest::GetHdmiPortInfo, "GetHdmiPortInfo"); + if (allTestsPassed) { cout << "============================" << endl; cout << "ALL MANAGE SDK TESTS SUCCEEDED!" << endl; diff --git a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp index 6dde2c9c2..04a2bb504 100644 --- a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp +++ b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp @@ -31,6 +31,7 @@ ManageSDKTest::OnPreferredAudioLanguagesChangedNotification ManageSDKTest::_pref ManageSDKTest::OnAllowACRCollectionChangedNotification ManageSDKTest::_allowACRCollectionChangedNotification; ManageSDKTest::OnSignInNotification ManageSDKTest::_signInNotification; ManageSDKTest::OnSignOutNotification ManageSDKTest::_signOutNotification; +ManageSDKTest::OnAutoLowLatencyModeCapableChangedNotification ManageSDKTest::_autoLowLatencyModeCapableChangedNotification; ManageSDKTest::KeyboardProvider ManageSDKTest::_keyboardProvider; ManageSDKTest::AcknowledgeChallengeProvider ManageSDKTest::_acknowledgeChallengeProvider; ManageSDKTest::PinChallengeProvider ManageSDKTest::_pinChallengeProvider; @@ -1012,3 +1013,104 @@ void ManageSDKTest::WifiDisconnect() throw std::runtime_error("WifiDisconnect failed. " + errorMessage); } } + +void ManageSDKTest::OnAutoLowLatencyModeCapableChangedNotification::onAutoLowLatencyModeCapableChanged( const Firebolt::HDMIInput::AutoLowLatencyModeCapableChangedInfo& info) +{ + cout << "Low latency capable changed" << endl; +} + +void ManageSDKTest::GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged() +{ + Firebolt::Error error = Firebolt::Error::None; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().globalSubscribe(_autoLowLatencyModeCapableChangedNotification, &error); + if (error == Firebolt::Error::None) { + cout << "Global Subscribe for HDMIInput AutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("SubscribeHDMIInputAutoLowLatencyModeCapable failed." + errorMessage); + } +} + +void ManageSDKTest::GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged() +{ + Firebolt::Error error = Firebolt::Error::None; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().globalUnsubscribe(_autoLowLatencyModeCapableChangedNotification, &error); + if (error == Firebolt::Error::None) { + cout << "Global Unsubscribe for HDMIInput AutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("UnsubscribeHDMIInputAutoLowLatencyModeCapable failed." + errorMessage); + } +} + +void ManageSDKTest::GetAutoLowLatencyModeCapable() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + bool result = Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().autoLowLatencyModeCapable(port, &error); + + if (error == Firebolt::Error::None) { + cout << "GetAutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("GetAutoLowLatencyModeCapable failed. " + errorMessage); + } +} + +void ManageSDKTest::SetAutoLowLatencyModeCapable() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + bool value = false; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().setAutoLowLatencyModeCapable(port, value, &error); + + if (error == Firebolt::Error::None) { + cout << "SetAutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("SetAutoLowLatencyModeCapable failed. " + errorMessage); + } +} + +void ManageSDKTest::GetEdidVersion() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().edidVersion(port, &error); + + if (error == Firebolt::Error::None) { + cout << "GetEdidVersion is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("GetEdidVersion failed. " + errorMessage); + } +} + +void ManageSDKTest::SetEdidVersion() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + Firebolt::HDMIInput::EDIDVersion value = Firebolt::HDMIInput::EDIDVersion::V1_4; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().setEdidVersion(port, value, &error); + + if (error == Firebolt::Error::None) { + cout << "SetEdidVersion is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("SetEdidVersionfailed. " + errorMessage); + } +} + +void ManageSDKTest::GetHdmiPortInfo() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string portId = "HDMI1"; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().port(portId, &error); + + if (error == Firebolt::Error::None) { + cout << "GetHdmiPortInfo is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("GetHdmiPortInfo failed. " + errorMessage); + } +} diff --git a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h index 2f8be7145..018350ec2 100644 --- a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h +++ b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h @@ -108,6 +108,11 @@ class ManageSDKTest { bool _challengeInput; }; + class OnAutoLowLatencyModeCapableChangedNotification : public Firebolt::HDMIInput::IHDMIInput::IOnAutoLowLatencyModeCapableChangedNotification { + public: + void onAutoLowLatencyModeCapableChanged( const Firebolt::HDMIInput::AutoLowLatencyModeCapableChangedInfo& ) override; + }; + public: ManageSDKTest() = default; virtual ~ManageSDKTest() = default; @@ -183,6 +188,15 @@ class ManageSDKTest { static void WifiConnect(); static void WifiDisconnect(); + static void GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged(); + static void GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged(); + + static void GetAutoLowLatencyModeCapable(); + static void SetAutoLowLatencyModeCapable(); + static void GetEdidVersion(); + static void SetEdidVersion(); + static void GetHdmiPortInfo(); + static bool WaitOnConnectionReady(); private: @@ -199,6 +213,7 @@ class ManageSDKTest { static PinChallengeProvider _pinChallengeProvider; static OnSignInNotification _signInNotification; static OnSignOutNotification _signOutNotification; + static OnAutoLowLatencyModeCapableChangedNotification _autoLowLatencyModeCapableChangedNotification; static Firebolt::Wifi::AccessPointList _apList; };