From 457d669e280fddc78d1f5c59ecb51ccb54728bde Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:04:38 +0200 Subject: [PATCH 1/9] Remove DeviceInfoJsonRpc.cpp from the cmake --- DeviceInfo/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/DeviceInfo/CMakeLists.txt b/DeviceInfo/CMakeLists.txt index 518eacf1..f0363b62 100644 --- a/DeviceInfo/CMakeLists.txt +++ b/DeviceInfo/CMakeLists.txt @@ -40,7 +40,6 @@ find_package(CompileSettingsDebug CONFIG REQUIRED) add_library(${MODULE_NAME} SHARED DeviceInfo.cpp - DeviceInfoJsonRpc.cpp DeviceInfoImplementation.cpp Module.cpp) From 82f6319ab1d4ca17c11e5a27950af1af760115dd Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:08:13 +0200 Subject: [PATCH 2/9] Adjust the source of DeviceInfo in-process part --- DeviceInfo/DeviceInfo.cpp | 393 ++++++++++++-------------------------- 1 file changed, 119 insertions(+), 274 deletions(-) diff --git a/DeviceInfo/DeviceInfo.cpp b/DeviceInfo/DeviceInfo.cpp index 61668081..8c2cbf50 100644 --- a/DeviceInfo/DeviceInfo.cpp +++ b/DeviceInfo/DeviceInfo.cpp @@ -36,13 +36,12 @@ namespace Plugin { ); } - static Core::ProxyPoolType> jsonResponseFactory(4); - /* virtual */ const string DeviceInfo::Initialize(PluginHost::IShell* service) { ASSERT(_service == nullptr); ASSERT(_subSystem == nullptr); ASSERT(_deviceInfo == nullptr); + ASSERT(_configuration == nullptr); ASSERT(service != nullptr); ASSERT(_connectionId == 0); @@ -66,16 +65,24 @@ namespace Plugin { message = _T("DeviceInfo could not be instantiated"); SYSLOG(Logging::Startup, (_T("DeviceInfo could not be instantiated"))); } else { - _deviceInfo->Configure(_service); - _deviceAudioCapabilityInterface = _deviceInfo->QueryInterface(); - if (_deviceAudioCapabilityInterface == nullptr) { - message = _T("DeviceInfo Audio Capabilities Interface could not be instantiated"); + _configuration = _deviceInfo->QueryInterface(); + if (_configuration == nullptr) { + message = _T("DeviceInfo Configuration Interface could not be instantiated"); } else { - _deviceVideoCapabilityInterface = _deviceInfo->QueryInterface(); - if (_deviceVideoCapabilityInterface == nullptr) { - message = _T("DeviceInfo Video Capabilities Interface could not be instantiated"); + _configuration->Configure(_service); + _deviceAudioCapabilityInterface = _deviceInfo->QueryInterface(); + if (_deviceAudioCapabilityInterface == nullptr) { + message = _T("DeviceInfo Audio Capabilities Interface could not be instantiated"); } else { - RegisterAll(); + _deviceVideoCapabilityInterface = _deviceInfo->QueryInterface(); + if (_deviceVideoCapabilityInterface == nullptr) { + message = _T("DeviceInfo Video Capabilities Interface could not be instantiated"); + } else { + Exchange::JSystemInfo::Register(*this, this); + Exchange::JDeviceInfo::Register(*this, _deviceInfo); + Exchange::JDeviceAudioCapabilities::Register(*this, _deviceAudioCapabilityInterface); + Exchange::JDeviceVideoCapabilities::Register(*this, _deviceVideoCapabilityInterface); + } } } } @@ -101,18 +108,25 @@ namespace Plugin { if (_deviceInfo != nullptr){ if (_deviceAudioCapabilityInterface != nullptr) { + Exchange::JDeviceAudioCapabilities::Unregister(*this); _deviceAudioCapabilityInterface->Release(); _deviceAudioCapabilityInterface = nullptr; } if (_deviceVideoCapabilityInterface != nullptr) { - UnregisterAll(); + Exchange::JDeviceVideoCapabilities::Unregister(*this); _deviceVideoCapabilityInterface->Release(); _deviceVideoCapabilityInterface = nullptr; } + if (_configuration != nullptr) { + _configuration->Release(); + _configuration = nullptr; + } RPC::IRemoteConnection* connection(_service->RemoteConnection(_connectionId)); + Exchange::JDeviceInfo::Unregister(*this); VARIABLE_IS_NOT_USED uint32_t result = _deviceInfo->Release(); _deviceInfo = nullptr; + Exchange::JSystemInfo::Unregister(*this); // It should have been the last reference we are releasing, // so it should endup in a DESTRUCTION_SUCCEEDED, if not we // are leaking... @@ -137,337 +151,168 @@ namespace Plugin { return (string()); } - /* virtual */ void DeviceInfo::Inbound(Web::Request& /* request */) + Core::hresult DeviceInfo::AudioOutputs(Exchange::IDeviceAudioCapabilities::IAudioOutputIterator*& audioOutputs) const { + Core::SafeSyncType lock(_adminLock); + return (_deviceAudioCapabilityInterface->AudioOutputs(audioOutputs)); } - /* virtual */ Core::ProxyType DeviceInfo::Process(const Web::Request& request) + Core::hresult DeviceInfo::AudioCapabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator*& audioCapabilities) const { - ASSERT(_skipURL <= request.Path.length()); - - Core::ProxyType result(PluginHost::IFactories::Instance().Response()); - - // By default, we assume everything works.. - result->ErrorCode = Web::STATUS_OK; - result->Message = "OK"; - - // - currently, only the GET command is supported, returning system info - if (request.Verb == Web::Request::HTTP_GET) { - - Core::ProxyType> response(jsonResponseFactory.Element()); - - Core::TextSegmentIterator index(Core::TextFragment(request.Path, _skipURL, static_cast(request.Path.length()) - _skipURL), false, '/'); - - // Always skip the first one, it is an empty part because we start with a '/' if there are more parameters. - index.Next(); - - if (index.Next() == false) { - AddressInfo(response->Addresses); - SysInfo(response->SystemInfo); - SocketPortInfo(response->Sockets); - } else if (index.Current() == "Adresses") { - AddressInfo(response->Addresses); - } else if (index.Current() == "System") { - SysInfo(response->SystemInfo); - } else if (index.Current() == "Sockets") { - SocketPortInfo(response->Sockets); - } - // TODO RB: I guess we should do something here to return other info (e.g. time) as well. - - result->ContentType = Web::MIMETypes::MIME_JSON; - result->Body(Core::ProxyType(response)); - } else { - result->ErrorCode = Web::STATUS_BAD_REQUEST; - result->Message = _T("Unsupported request for the [DeviceInfo] service."); - } - - return result; + Core::SafeSyncType lock(_adminLock); + return (_deviceAudioCapabilityInterface->AudioCapabilities(audioOutput, audioCapabilities)); } - void DeviceInfo::SysInfo(JsonData::DeviceInfo::SysteminfoData& systemInfo) const + Core::hresult DeviceInfo::MS12Capabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator*& ms12Capabilities) const { - Core::SystemInfo& singleton(Core::SystemInfo::Instance()); - - systemInfo.Time = Core::Time::Now().ToRFC1123(true); - systemInfo.Version = _subSystem->Version() + _T("#") + _subSystem->BuildTreeHash(); - systemInfo.Uptime = singleton.GetUpTime(); - systemInfo.Freeram = singleton.GetFreeRam(); - systemInfo.Totalram = singleton.GetTotalRam(); - systemInfo.Devicename = singleton.GetHostName(); - systemInfo.Cpuload = Core::NumberType(static_cast(singleton.GetCpuLoad())).Text(); - - _adminLock.Lock(); - systemInfo.Serialnumber = _deviceId; - _adminLock.Unlock(); + Core::SafeSyncType lock(_adminLock); + return (_deviceAudioCapabilityInterface->MS12Capabilities(audioOutput, ms12Capabilities)); } - void DeviceInfo::AddressInfo(Core::JSON::ArrayType& addressInfo) const + Core::hresult DeviceInfo::MS12AudioProfiles(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator*& ms12Profiles) const { - // Get the point of entry on Thunder.. - Core::AdapterIterator interfaces; - - while (interfaces.Next() == true) { - - JsonData::DeviceInfo::AddressesData newElement; - newElement.Name = interfaces.Name(); - newElement.Mac = interfaces.MACAddress(':'); - JsonData::DeviceInfo::AddressesData& element(addressInfo.Add(newElement)); - - // get an interface with a public IP address, then we will have a proper MAC address.. - Core::IPV4AddressIterator selectedNode(interfaces.IPV4Addresses()); - - while (selectedNode.Next() == true) { - Core::JSON::String nodeName; - nodeName = selectedNode.Address().HostAddress(); + Core::SafeSyncType lock(_adminLock); + return (_deviceAudioCapabilityInterface->MS12AudioProfiles(audioOutput, ms12Profiles)); + } - element.Ip.Add(nodeName); - } - } + Core::hresult DeviceInfo::VideoOutputs(Exchange::IDeviceVideoCapabilities::IVideoOutputIterator*& videoOutputs) const + { + Core::SafeSyncType lock(_adminLock); + return (_deviceVideoCapabilityInterface->VideoOutputs(videoOutputs)); } - void DeviceInfo::SocketPortInfo(JsonData::DeviceInfo::SocketinfoData& socketPortInfo) const + Core::hresult DeviceInfo::DefaultResolution(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::ScreenResolution& defaultResolution) const { - socketPortInfo.Runs = Core::ResourceMonitor::Instance().Runs(); + Core::SafeSyncType lock(_adminLock); + return (_deviceVideoCapabilityInterface->DefaultResolution(videoOutput, defaultResolution)); } - uint32_t DeviceInfo::AudioOutputs(AudioOutputTypes& audioOutputs) const + Core::hresult DeviceInfo::Resolutions(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator*& resolutions) const { - Exchange::IDeviceAudioCapabilities::IAudioOutputIterator* audioIt; - - uint32_t status = _deviceAudioCapabilityInterface->AudioOutputs(audioIt); - if ((status == Core::ERROR_NONE) && (audioIt != nullptr)) { - Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput; - Core::JSON::EnumType jsonAudioOutput; - while (audioIt->Next(audioOutput) == true) { - jsonAudioOutput = static_cast(audioOutput); - audioOutputs.Add(jsonAudioOutput); - } - audioIt->Release(); - } - return status; + Core::SafeSyncType lock(_adminLock); + return (_deviceVideoCapabilityInterface->Resolutions(videoOutput, resolutions)); } - uint32_t DeviceInfo::AudioCapabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, AudioCapabilityTypes& audioCapabilityTypes) const + Core::hresult DeviceInfo::Hdcp(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::CopyProtection& hdcpVersion) const { - Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator* audioCapabilityIt = nullptr; - Exchange::IDeviceAudioCapabilities::AudioCapability audioCapabilty( - Exchange::IDeviceAudioCapabilities::AudioCapability::AUDIOCAPABILITY_NONE); - - uint32_t status = _deviceAudioCapabilityInterface->AudioCapabilities(audioOutput, audioCapabilityIt); - if ((status == Core::ERROR_NONE) && (audioCapabilityIt != nullptr)) { - Core::JSON::EnumType jsonAudioCapability; - while (audioCapabilityIt->Next(audioCapabilty)) { - jsonAudioCapability = static_cast(audioCapabilty); - audioCapabilityTypes.Add(jsonAudioCapability); - } - audioCapabilityIt->Release(); - } + Core::SafeSyncType lock(_adminLock); + return (_deviceVideoCapabilityInterface->Hdcp(videoOutput, hdcpVersion)); + } - return (status); + Core::hresult DeviceInfo::HostEDID(string& edid) const + { + Core::SafeSyncType lock(_adminLock); + return (_deviceVideoCapabilityInterface->HostEDID(edid)); } - uint32_t DeviceInfo::Ms12Capabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Ms12CapabilityTypes& ms12CapabilityTypes) const + Core::hresult DeviceInfo::Version(string& value) const { - Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator* ms12CapabilityIt = nullptr; - Exchange::IDeviceAudioCapabilities::MS12Capability ms12Capabilty( - Exchange::IDeviceAudioCapabilities::MS12Capability::MS12CAPABILITY_NONE); - - uint32_t status = _deviceAudioCapabilityInterface->MS12Capabilities(audioOutput, ms12CapabilityIt); - if ((status == Core::ERROR_NONE) && (ms12CapabilityIt != nullptr)) { - Core::JSON::EnumType jsonMs12Capability; - while (ms12CapabilityIt->Next(ms12Capabilty)) { - jsonMs12Capability = static_cast(ms12Capabilty); - ms12CapabilityTypes.Add(jsonMs12Capability); - } - ms12CapabilityIt->Release(); - } + _adminLock.Lock(); + value = (_subSystem->Version() + _T("#") + _subSystem->BuildTreeHash()); + _adminLock.Unlock(); - return (status); + return (Core::ERROR_NONE); } - uint32_t DeviceInfo::Ms12Profiles(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Ms12ProfileTypes& ms12ProfileTypes) const + Core::hresult DeviceInfo::Uptime(uint32_t& value) const { - Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator* ms12ProfileIt = nullptr; - Exchange::IDeviceAudioCapabilities::MS12Profile ms12Profile( - Exchange::IDeviceAudioCapabilities::MS12Profile::MS12PROFILE_NONE); - - uint32_t status = _deviceAudioCapabilityInterface->MS12AudioProfiles(audioOutput, ms12ProfileIt); - if ((status == Core::ERROR_NONE) && (ms12ProfileIt != nullptr)) { - Core::JSON::EnumType jsonMs12Profile; - while (ms12ProfileIt->Next(ms12Profile)) { - jsonMs12Profile = static_cast(ms12Profile); - ms12ProfileTypes.Add(jsonMs12Profile); - } - ms12ProfileIt->Release(); - } + value = Core::SystemInfo::Instance().GetUpTime(); - return (status); + return (Core::ERROR_NONE); } - void DeviceInfo::AudioCapabilitiesInfo(JsonData::DeviceInfo::DeviceaudiocapabilitiesData& response) const + Core::hresult DeviceInfo::TotalRAM(uint64_t& value) const { - Exchange::IDeviceAudioCapabilities::IAudioOutputIterator* audioIt = nullptr; - if ((_deviceAudioCapabilityInterface->AudioOutputs(audioIt) == Core::ERROR_NONE) && - (audioIt != nullptr)) { - Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput; + value = Core::SystemInfo::Instance().GetTotalRam(); - while (audioIt->Next(audioOutput)) { - JsonData::DeviceInfo::DeviceaudiocapabilitiesData::AudiooutputcapabilitiesData audiocapabilities; - audiocapabilities.AudioPort = - static_cast(audioOutput); + return (Core::ERROR_NONE); + } - AudioCapabilities(audioOutput, audiocapabilities.Audiocapabilities); - Ms12Capabilities(audioOutput, audiocapabilities.Ms12capabilities); - Ms12Profiles(audioOutput, audiocapabilities.Ms12profiles); + Core::hresult DeviceInfo::FreeRAM(uint64_t& value) const + { + value = Core::SystemInfo::Instance().GetFreeRam(); - response.Audiooutputcapabilities.Add(audiocapabilities); - } - audioIt->Release(); - } + return (Core::ERROR_NONE); } - uint32_t DeviceInfo::VideoOutputs(VideoOutputTypes& videoOutputs) const + Core::hresult DeviceInfo::TotalSwap(uint64_t& value) const { - Exchange::IDeviceVideoCapabilities::IVideoOutputIterator* videoIt; - - uint32_t status = _deviceVideoCapabilityInterface->VideoOutputs(videoIt); - if ((status == Core::ERROR_NONE) && (videoIt != nullptr)) { - Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput; - Core::JSON::EnumType jsonVideoOutput; - while (videoIt->Next(videoOutput) == true) { - jsonVideoOutput = static_cast(videoOutput); - videoOutputs.Add(jsonVideoOutput); - } - videoIt->Release(); - } - return status; + value = Core::SystemInfo::Instance().GetTotalSwap(); + + return (Core::ERROR_NONE); } - uint32_t DeviceInfo::DefaultResolution(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, ScreenResolutionType& screenResolutionType) const + Core::hresult DeviceInfo::FreeSwap(uint64_t& value) const { - Exchange::IDeviceVideoCapabilities::ScreenResolution defaultResolution( - Exchange::IDeviceVideoCapabilities::ScreenResolution::ScreenResolution_Unknown); - uint32_t status = _deviceVideoCapabilityInterface->DefaultResolution(videoOutput, defaultResolution); + value = Core::SystemInfo::Instance().GetFreeSwap(); - if (status == Core::ERROR_NONE) { - screenResolutionType = static_cast(defaultResolution); - } - return (status); + return (Core::ERROR_NONE); } - uint32_t DeviceInfo::Resolutions(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, ScreenResolutionTypes& screenResolutionTypes) const + Core::hresult DeviceInfo::DeviceName(string& value) const { - Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator* resolutionIt = nullptr; - Exchange::IDeviceVideoCapabilities::ScreenResolution resolution( - Exchange::IDeviceVideoCapabilities::ScreenResolution::ScreenResolution_Unknown); - - uint32_t status = _deviceVideoCapabilityInterface->Resolutions(videoOutput, resolutionIt); - if ((status == Core::ERROR_NONE) && (resolutionIt != nullptr)) { - Core::JSON::EnumType jsonResolution; - while (resolutionIt->Next(resolution)) { - jsonResolution = static_cast(resolution); - screenResolutionTypes.Add(jsonResolution); - } - resolutionIt->Release(); - } - return (status); + value = Core::SystemInfo::Instance().GetHostName(); + + return (Core::ERROR_NONE); } - uint32_t DeviceInfo::Hdcp(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, CopyProtectionType& copyProtectionType) const + Core::hresult DeviceInfo::CPULoad(uint8_t& value) const { - Exchange::IDeviceVideoCapabilities::CopyProtection hdcp( - Exchange::IDeviceVideoCapabilities::CopyProtection::HDCP_UNAVAILABLE); + value = static_cast(Core::SystemInfo::Instance().GetCpuLoad()); - uint32_t status = _deviceVideoCapabilityInterface->Hdcp(videoOutput, hdcp); - if (status == Core::ERROR_NONE) { - copyProtectionType = static_cast(hdcp); - } - return (status); + return (Core::ERROR_NONE); } - void DeviceInfo::VideoCapabilitiesInfo(JsonData::DeviceInfo::DevicevideocapabilitiesData& response) const + Core::hresult DeviceInfo::CPULoadAvgs(Exchange::ISystemInfo::CPULoads& value) const { - ASSERT(_deviceVideoCapabilityInterface != nullptr); - - bool supportsHdr = false; - if (_deviceVideoCapabilityInterface->HDR(supportsHdr) == Core::ERROR_NONE) { - response.Hdr = supportsHdr; - } + uint64_t* loadAvgs = Core::SystemInfo::Instance().GetCpuLoadAvg(); + value.avg1min = static_cast(loadAvgs[0]); + value.avg5min = static_cast(loadAvgs[1]); + value.avg15min = static_cast(loadAvgs[2]); - bool supportsAtmos = false; - if (_deviceVideoCapabilityInterface->Atmos(supportsAtmos) == Core::ERROR_NONE) { - response.Atmos = supportsAtmos; - } + return (Core::ERROR_NONE); + } - bool supportsCec = false; - if (_deviceVideoCapabilityInterface->CEC(supportsCec) == Core::ERROR_NONE) { - response.Cec = supportsCec; - } + Core::hresult DeviceInfo::Addresses(Exchange::ISystemInfo::INetworkInterfaceIterator*& networkInterfaces) const + { + // Get the point of entry on Thunder.. + Core::AdapterIterator interfaces; + std::vector list; - HostEDID(response.Hostedid); + while (interfaces.Next() == true) { - Exchange::IDeviceVideoCapabilities::IVideoOutputIterator* videoIt; - if ((_deviceVideoCapabilityInterface->VideoOutputs(videoIt) == Core::ERROR_NONE) && - (videoIt != nullptr)) { - Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput; - while (videoIt->Next(videoOutput) == true) { - JsonData::DeviceInfo::DevicevideocapabilitiesData::VideooutputcapabilitiesData videocapabilities; - videocapabilities.VideoDisplay = - static_cast(videoOutput); + Exchange::ISystemInfo::NetworkInterface newElement; - Hdcp(videoOutput, videocapabilities.Hdcp); + newElement.name = interfaces.Name(); + newElement.mac = interfaces.MACAddress(':'); - DefaultResolution(videoOutput, videocapabilities.Defaultresolution); + // get an interface with a public IP address, then we will have a proper MAC address.. + Core::IPV4AddressIterator selectedNode(interfaces.IPV4Addresses()); - Resolutions(videoOutput, videocapabilities.Output_resolutions); + std::vector ipAddresses; - response.Videooutputcapabilities.Add(videocapabilities); + while (selectedNode.Next() == true) { + ipAddresses.push_back(selectedNode.Address().HostAddress()); } - videoIt->Release(); - } - } - - void DeviceInfo::DeviceMetaData(JsonData::DeviceInfo::DeviceinfoData& response) const - { - ASSERT(_deviceInfo != nullptr); - string localresult ; - - if (_deviceInfo->DeviceType(localresult) == Core::ERROR_NONE) { - response.Devicetype = localresult; - } - - if (_deviceInfo->DistributorId(localresult) == Core::ERROR_NONE) { - response.Distributorid = localresult; - } - if (_deviceInfo->FriendlyName(localresult) == Core::ERROR_NONE) { - response.Friendlyname = localresult; - } - - if (_deviceInfo->Make(localresult) == Core::ERROR_NONE) { - response.Make = localresult; - } + if (ipAddresses.size() > 0) { + newElement.ipAddresses = std::move(ipAddresses); + } - if (_deviceInfo->ModelName(localresult) == Core::ERROR_NONE) { - response.Modelname = localresult; + list.push_back(newElement); } - uint16_t year = 0; - if (_deviceInfo->ModelYear(year) == Core::ERROR_NONE) { - response.Modelyear = year; - } + using Implementation = RPC::IteratorType; + networkInterfaces = Core::ServiceType::Create(list); - if (_deviceInfo->PlatformName(localresult) == Core::ERROR_NONE) { - response.Platformname = localresult; - } + return (Core::ERROR_NONE); + } - if (_deviceInfo->SerialNumber(localresult) == Core::ERROR_NONE) { - response.Serialnumber = localresult; - } + Core::hresult DeviceInfo::SocketInfo(Exchange::ISystemInfo::Sockets& socketInfo) const + { + socketInfo.runs = Core::ResourceMonitor::Instance().Runs(); - if (_deviceInfo->Sku(localresult) == Core::ERROR_NONE) { - response.Sku = localresult; - } + return (Core::ERROR_NONE); } void DeviceInfo::UpdateDeviceIdentifier() From a854b9e8098acaf39c4e9fc7272a214b1327fae7 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:18:01 +0200 Subject: [PATCH 3/9] Adjust the header of DeviceInfo in-process part to match the new interface changes --- DeviceInfo/DeviceInfo.h | 143 ++++++++++------------------------------ 1 file changed, 34 insertions(+), 109 deletions(-) diff --git a/DeviceInfo/DeviceInfo.h b/DeviceInfo/DeviceInfo.h index dd86247e..2edebc30 100644 --- a/DeviceInfo/DeviceInfo.h +++ b/DeviceInfo/DeviceInfo.h @@ -21,34 +21,19 @@ #define DEVICEINFO_DEVICEINFO_H #include "Module.h" +#include #include -#include +#include +#include +#include +#include namespace Thunder { namespace Plugin { - class DeviceInfo : public PluginHost::IPlugin, public PluginHost::IWeb, public PluginHost::JSONRPC { - public: - class Data : public Core::JSON::Container { - public: - Data() - : Core::JSON::Container() - , Addresses() - , SystemInfo() - { - Add(_T("addresses"), &Addresses); - Add(_T("systeminfo"), &SystemInfo); - Add(_T("sockets"), &Sockets); - } - - ~Data() override = default; - - public: - Core::JSON::ArrayType Addresses; - JsonData::DeviceInfo::SysteminfoData SystemInfo; - JsonData::DeviceInfo::SocketinfoData Sockets; - }; - + class DeviceInfo : public PluginHost::IPlugin + , public PluginHost::JSONRPC + , public Exchange::ISystemInfo { private: class Notification : public PluginHost::ISubSystem::INotification, public RPC::IRemoteConnection::INotification { private: @@ -106,23 +91,6 @@ namespace Plugin { Core::WorkerPool::JobType _job; }; - private: - uint32_t addresses(const Core::JSON::String&, Core::JSON::ArrayType& response) - { - AddressInfo(response); - return (Core::ERROR_NONE); - } - uint32_t system(const Core::JSON::String&, JsonData::DeviceInfo::SysteminfoData& response) - { - SysInfo(response); - return (Core::ERROR_NONE); - } - uint32_t sockets(const Core::JSON::String&, JsonData::DeviceInfo::SocketinfoData& response) - { - SocketPortInfo(response); - return (Core::ERROR_NONE); - } - public: DeviceInfo(const DeviceInfo&) = delete; DeviceInfo& operator=(const DeviceInfo&) = delete; @@ -132,6 +100,7 @@ namespace Plugin { , _subSystem(nullptr) , _deviceId() , _deviceInfo(nullptr) + , _configuration(nullptr) , _deviceAudioCapabilityInterface(nullptr) , _deviceVideoCapabilityInterface(nullptr) , _connectionId(0) @@ -144,9 +113,10 @@ namespace Plugin { BEGIN_INTERFACE_MAP(DeviceInfo) INTERFACE_ENTRY(PluginHost::IPlugin) - INTERFACE_ENTRY(PluginHost::IWeb) INTERFACE_ENTRY(PluginHost::IDispatcher) + INTERFACE_ENTRY(Exchange::ISystemInfo) INTERFACE_AGGREGATE(Exchange::IDeviceInfo, _deviceInfo) + INTERFACE_AGGREGATE(Exchange::IConfiguration, _configuration) INTERFACE_AGGREGATE(Exchange::IDeviceAudioCapabilities, _deviceAudioCapabilityInterface) INTERFACE_AGGREGATE(Exchange::IDeviceVideoCapabilities, _deviceVideoCapabilityInterface) END_INTERFACE_MAP @@ -158,85 +128,40 @@ namespace Plugin { virtual void Deinitialize(PluginHost::IShell* service) override; virtual string Information() const override; - // IWeb methods - // ------------------------------------------------------------------------------------------------------- - virtual void Inbound(Web::Request& request) override; - virtual Core::ProxyType Process(const Web::Request& request) override; - private: - // JsonRpc - void RegisterAll(); - void UnregisterAll(); - uint32_t endpoint_supportedresolutions(const JsonData::DeviceInfo::SupportedresolutionsParamsInfo& params, JsonData::DeviceInfo::SupportedresolutionsResultData& response); - uint32_t endpoint_defaultresolution(const JsonData::DeviceInfo::SupportedresolutionsParamsInfo& params, JsonData::DeviceInfo::DefaultresolutionResultData& response); - uint32_t endpoint_supportedhdcp(const JsonData::DeviceInfo::SupportedresolutionsParamsInfo& params, JsonData::DeviceInfo::SupportedhdcpResultData& response); - uint32_t endpoint_audiocapabilities(const JsonData::DeviceInfo::AudiocapabilitiesParamsInfo& params, JsonData::DeviceInfo::AudiocapabilitiesResultData& response); - uint32_t endpoint_ms12capabilities(const JsonData::DeviceInfo::AudiocapabilitiesParamsInfo& params, JsonData::DeviceInfo::Ms12capabilitiesResultData& response); - uint32_t endpoint_supportedms12audioprofiles(const JsonData::DeviceInfo::AudiocapabilitiesParamsInfo& params, JsonData::DeviceInfo::Supportedms12audioprofilesResultData& response); - uint32_t endpoint_get_deviceaudiocapabilities(JsonData::DeviceInfo::DeviceaudiocapabilitiesData& response) const; - uint32_t endpoint_get_devicevideocapabilities(JsonData::DeviceInfo::DevicevideocapabilitiesData& response) const; - uint32_t endpoint_get_deviceinfo(JsonData::DeviceInfo::DeviceinfoData& response) const; - uint32_t endpoint_get_systeminfo(JsonData::DeviceInfo::SysteminfoData& response) const; - uint32_t endpoint_get_addresses(Core::JSON::ArrayType& response) const; - uint32_t endpoint_get_socketinfo(JsonData::DeviceInfo::SocketinfoData& response) const; - uint32_t endpoint_get_supportedaudioports(JsonData::DeviceInfo::SupportedaudioportsData& response) const; - uint32_t endpoint_get_supportedvideodisplays(JsonData::DeviceInfo::SupportedvideodisplaysData& response) const; - uint32_t endpoint_get_hostedid(JsonData::DeviceInfo::HostedidData& response) const; - uint32_t endpoint_get_firmwareversion(JsonData::DeviceInfo::FirmwareversionData& response) const; - uint32_t endpoint_get_serialnumber(JsonData::DeviceInfo::SerialnumberData& response) const; - uint32_t endpoint_get_modelid(JsonData::DeviceInfo::ModelidData& response) const; - uint32_t endpoint_get_make(JsonData::DeviceInfo::MakeData& response) const; - uint32_t endpoint_get_modelname(JsonData::DeviceInfo::ModelnameData& response) const; - uint32_t endpoint_get_modelyear(JsonData::DeviceInfo::ModelyearData& response) const; - uint32_t endpoint_get_friendlyname(JsonData::DeviceInfo::FriendlynameInfo& response) const; - uint32_t endpoint_get_platformname(JsonData::DeviceInfo::FriendlynameInfo& response) const; - uint32_t endpoint_get_devicetype(JsonData::DeviceInfo::DevicetypeData& response) const; - uint32_t endpoint_get_distributorid(JsonData::DeviceInfo::DistributoridData& response) const; - - void SysInfo(JsonData::DeviceInfo::SysteminfoData& systemInfo) const; - void AddressInfo(Core::JSON::ArrayType& addressInfo) const; - void SocketPortInfo(JsonData::DeviceInfo::SocketinfoData& socketPortInfo) const; - void AudioCapabilitiesInfo(JsonData::DeviceInfo::DeviceaudiocapabilitiesData& response) const; - void VideoCapabilitiesInfo(JsonData::DeviceInfo::DevicevideocapabilitiesData& response) const; - void DeviceMetaData(JsonData::DeviceInfo::DeviceinfoData& response) const; + Core::hresult AudioOutputs(Exchange::IDeviceAudioCapabilities::IAudioOutputIterator*& audioOutputs) const; + Core::hresult AudioCapabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator*& audioCapabilities) const; + Core::hresult MS12Capabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator*& ms12Capabilities) const; + Core::hresult MS12AudioProfiles(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator*& ms12Profiles) const; + + Core::hresult VideoOutputs(Exchange::IDeviceVideoCapabilities::IVideoOutputIterator*& videoOutputs) const; + Core::hresult DefaultResolution(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::ScreenResolution& defaultResolution) const; + Core::hresult Resolutions(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator*& resolutions) const; + Core::hresult Hdcp(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::CopyProtection& hdcpVersion) const; + Core::hresult HostEDID(string& edid) const; + + Core::hresult Version(string& value) const override; + Core::hresult Uptime(uint32_t& value) const override; + Core::hresult TotalRAM(uint64_t& value) const override; + Core::hresult FreeRAM(uint64_t& value) const override; + Core::hresult TotalSwap(uint64_t& value) const override; + Core::hresult FreeSwap(uint64_t& value) const override; + Core::hresult DeviceName(string& value) const override; + Core::hresult CPULoad(uint8_t& value) const override; + Core::hresult CPULoadAvgs(Exchange::ISystemInfo::CPULoads& value) const override; + Core::hresult Addresses(Exchange::ISystemInfo::INetworkInterfaceIterator*& networkInterfaces) const override; + Core::hresult SocketInfo(Exchange::ISystemInfo::Sockets& socketInfo) const override; void UpdateDeviceIdentifier(); void Deactivated(RPC::IRemoteConnection* connection); - using VideoOutputTypes = Core::JSON::ArrayType>; - using ScreenResolutionType = Core::JSON::EnumType; - using ScreenResolutionTypes = Core::JSON::ArrayType; - using CopyProtectionType = Core::JSON::EnumType; - uint32_t VideoOutputs(VideoOutputTypes& videoOutputs) const; - uint32_t DefaultResolution(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, ScreenResolutionType& screenResolutionType) const; - uint32_t Resolutions(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, ScreenResolutionTypes& screenResolutionTypes) const; - uint32_t Hdcp(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, CopyProtectionType& copyProtectionType) const; - - using AudioOutputTypes = Core::JSON::ArrayType>; - using AudioCapabilityTypes = Core::JSON::ArrayType>; - using Ms12CapabilityTypes = Core::JSON::ArrayType>; - using Ms12ProfileTypes = Core::JSON::ArrayType>; - uint32_t AudioOutputs(AudioOutputTypes& audioOutputs) const; - uint32_t AudioCapabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, AudioCapabilityTypes& audioCapabilityTypes) const; - uint32_t Ms12Capabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Ms12CapabilityTypes& ms12CapabilityTypes) const; - uint32_t Ms12Profiles(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Ms12ProfileTypes& ms12ProfileTypes) const; - - inline uint32_t HostEDID(Core::JSON::String& Hostedid) const - { - string edid; - uint32_t status = _deviceVideoCapabilityInterface->HostEDID(edid); - if (status == Core::ERROR_NONE) { - Hostedid = edid; - } - return status; - } - private: uint8_t _skipURL; PluginHost::IShell* _service; PluginHost::ISubSystem* _subSystem; string _deviceId; Exchange::IDeviceInfo* _deviceInfo; + Exchange::IConfiguration* _configuration; Exchange::IDeviceAudioCapabilities* _deviceAudioCapabilityInterface; Exchange::IDeviceVideoCapabilities* _deviceVideoCapabilityInterface; uint32_t _connectionId; From 328ef3b0daebe9e40ac4a86060d391ddc6755c61 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:21:31 +0200 Subject: [PATCH 4/9] Adjust the out of process source to match the interface changes --- DeviceInfo/DeviceInfoImplementation.cpp | 113 +++++++++++++++--------- 1 file changed, 72 insertions(+), 41 deletions(-) diff --git a/DeviceInfo/DeviceInfoImplementation.cpp b/DeviceInfo/DeviceInfoImplementation.cpp index 4bf234ad..793bb690 100644 --- a/DeviceInfo/DeviceInfoImplementation.cpp +++ b/DeviceInfo/DeviceInfoImplementation.cpp @@ -14,7 +14,7 @@ namespace Plugin { using ResolutionJsonArray = Core::JSON::ArrayType>; using ResolutionIteratorImplementation = RPC::IteratorType; - uint32_t DeviceInfoImplementation::Configure(const PluginHost::IShell* service) + uint32_t DeviceInfoImplementation::Configure(PluginHost::IShell* service) { ASSERT(service != nullptr); @@ -71,7 +71,7 @@ namespace Plugin { return (Core::ERROR_NONE); } - uint32_t DeviceInfoImplementation::AudioOutputs(Exchange::IDeviceAudioCapabilities::IAudioOutputIterator*& audioOutputs) const + Core::hresult DeviceInfoImplementation::AudioOutputs(Exchange::IDeviceAudioCapabilities::IAudioOutputIterator*& audioOutputs) const { AudioOutputList audioOutputList; @@ -84,7 +84,7 @@ namespace Plugin { return (audioOutputs != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL); } - uint32_t DeviceInfoImplementation::AudioCapabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator*& audioCapabilities) const + Core::hresult DeviceInfoImplementation::AudioCapabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator*& audioCapabilities) const { AudioOutputMap::const_iterator index = _audioOutputMap.find(audioOutput); if ((index != _audioOutputMap.end()) && (index->second.AudioCapabilities.size() > 0)) { @@ -93,7 +93,7 @@ namespace Plugin { return (audioCapabilities != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL); } - uint32_t DeviceInfoImplementation::MS12Capabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator*& ms12Capabilities) const + Core::hresult DeviceInfoImplementation::MS12Capabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator*& ms12Capabilities) const { AudioOutputMap::const_iterator index = _audioOutputMap.find(audioOutput); if ((index != _audioOutputMap.end()) && (index->second.MS12Capabilities.size() > 0)) { @@ -102,7 +102,7 @@ namespace Plugin { return (ms12Capabilities != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL); } - uint32_t DeviceInfoImplementation::MS12AudioProfiles(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator*& ms12AudioProfiles) const + Core::hresult DeviceInfoImplementation::MS12AudioProfiles(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator*& ms12AudioProfiles) const { AudioOutputMap::const_iterator index = _audioOutputMap.find(audioOutput); if ((index != _audioOutputMap.end()) && (index->second.MS12Profiles.size() > 0)) { @@ -111,7 +111,7 @@ namespace Plugin { return (ms12AudioProfiles != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL); } - uint32_t DeviceInfoImplementation::VideoOutputs(Exchange::IDeviceVideoCapabilities::IVideoOutputIterator*& videoOutputs) const + Core::hresult DeviceInfoImplementation::VideoOutputs(Exchange::IDeviceVideoCapabilities::IVideoOutputIterator*& videoOutputs) const { VideoOutputList videoOutputList; @@ -125,64 +125,81 @@ namespace Plugin { return (videoOutputs != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL); } - uint32_t DeviceInfoImplementation::DefaultResolution(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::ScreenResolution& defaultResolution) const + Core::hresult DeviceInfoImplementation::DefaultResolution(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::ScreenResolution& defaultResolution) const { - defaultResolution = Exchange::IDeviceVideoCapabilities::ScreenResolution_Unknown; + Core::hresult result = Core::ERROR_UNKNOWN_KEY; + VideoOutputMap::const_iterator index = _videoOutputMap.find(videoOutput); - if ((index != _videoOutputMap.end()) && (index->second.DefaultResolution != Exchange::IDeviceVideoCapabilities::ScreenResolution_Unknown)) { + + if (index != _videoOutputMap.end()) { defaultResolution = index->second.DefaultResolution; + result = Core::ERROR_NONE; } - return (Core::ERROR_NONE); + + return (result); } - uint32_t DeviceInfoImplementation::Resolutions(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator*& resolutions) const + Core::hresult DeviceInfoImplementation::Resolutions(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator*& resolutions) const { + Core::hresult result = Core::ERROR_UNKNOWN_KEY; + VideoOutputMap::const_iterator index = _videoOutputMap.find(videoOutput); - if ((index != _videoOutputMap.end()) && (index->second.Resolutions.size() > 0)) { - resolutions = Core::ServiceType::Create(index->second.Resolutions); + + if ((index != _videoOutputMap.end())) { + + if (index->second.Resolutions.size() > 0) { + resolutions = Core::ServiceType::Create(index->second.Resolutions); + result = Core::ERROR_NONE; + } + else { + result = Core::ERROR_GENERAL; + } } - return (resolutions != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL); + return (result); } - uint32_t DeviceInfoImplementation::Hdcp(const VideoOutput videoOutput, CopyProtection& hdcpVersion) const + Core::hresult DeviceInfoImplementation::Hdcp(const VideoOutput videoOutput, CopyProtection& hdcpVersion) const { - hdcpVersion = Exchange::IDeviceVideoCapabilities::CopyProtection::HDCP_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNKNOWN_KEY; + VideoOutputMap::const_iterator index = _videoOutputMap.find(videoOutput); - if ((index != _videoOutputMap.end()) && (index->second.CopyProtection != HDCP_UNAVAILABLE)) { + + if (index != _videoOutputMap.end()) { hdcpVersion = index->second.CopyProtection; + result = Core::ERROR_NONE; } - return (Core::ERROR_NONE); + return (result); } - uint32_t DeviceInfoImplementation::HDR(bool& supportsHDR) const + Core::hresult DeviceInfoImplementation::HDR(bool& supportsHDR) const { supportsHDR = _supportsHdr; return Core::ERROR_NONE; } - uint32_t DeviceInfoImplementation::Atmos(bool& supportsAtmos) const + Core::hresult DeviceInfoImplementation::Atmos(bool& supportsAtmos) const { supportsAtmos = _supportsAtmos; return Core::ERROR_NONE; } - uint32_t DeviceInfoImplementation::CEC(bool& supportsCEC) const + Core::hresult DeviceInfoImplementation::CEC(bool& supportsCEC) const { supportsCEC = _supportsCEC; return Core::ERROR_NONE; } - uint32_t DeviceInfoImplementation::HostEDID(string& edid) const + Core::hresult DeviceInfoImplementation::HostEDID(string& edid) const { edid = _hostEdid; return Core::ERROR_NONE; } - uint32_t DeviceInfoImplementation::Make(string& value) const + Core::hresult DeviceInfoImplementation::Make(string& value) const { - uint32_t result = Core::ERROR_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNAVAILABLE; if (_make.empty() == false) { value = _make; result = Core::ERROR_NONE; @@ -190,7 +207,7 @@ namespace Plugin { return result; } - uint32_t DeviceInfoImplementation::SerialNumber(string& value) const + Core::hresult DeviceInfoImplementation::SerialNumber(string& value) const { uint32_t result = Core::ERROR_UNAVAILABLE; if (_serialNumber.empty() == false) { @@ -200,7 +217,7 @@ namespace Plugin { return result; } - uint32_t DeviceInfoImplementation::Sku(string& value) const + Core::hresult DeviceInfoImplementation::ModelID(string& value) const { uint32_t result = Core::ERROR_UNAVAILABLE; if (_sku.empty() == false) { @@ -210,9 +227,9 @@ namespace Plugin { return result; } - uint32_t DeviceInfoImplementation::ModelName(string& value) const + Core::hresult DeviceInfoImplementation::ModelName(string& value) const { - uint32_t result = Core::ERROR_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNAVAILABLE; if (_modelName.empty() == false) { value = _modelName; result = Core::ERROR_NONE; @@ -220,9 +237,9 @@ namespace Plugin { return result; } - uint32_t DeviceInfoImplementation::ModelYear(uint16_t& value) const + Core::hresult DeviceInfoImplementation::ModelYear(uint16_t& value) const { - uint32_t result = Core::ERROR_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNAVAILABLE; if (_modelYear != 0) { value = _modelYear; result = Core::ERROR_NONE; @@ -230,9 +247,9 @@ namespace Plugin { return result; } - uint32_t DeviceInfoImplementation::FriendlyName(string& value) const + Core::hresult DeviceInfoImplementation::FriendlyName(string& value) const { - uint32_t result = Core::ERROR_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNAVAILABLE; if (_friendlyName.empty() == false) { value = _friendlyName; result = Core::ERROR_NONE; @@ -240,19 +257,29 @@ namespace Plugin { return result; } - uint32_t DeviceInfoImplementation::DeviceType(string& value) const + Core::hresult DeviceInfoImplementation::DeviceType(Exchange::IDeviceInfo::Type& value) const { - uint32_t result = Core::ERROR_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNAVAILABLE; + if (_deviceType.empty() == false) { - value = _deviceType; - result = Core::ERROR_NONE; + + Core::EnumerateType deviceTypeEnum(_deviceType.c_str(), false); + + if (deviceTypeEnum.IsSet()) { + value = deviceTypeEnum.Value(); + result = Core::ERROR_NONE; + } + else { + TRACE(Trace::Fatal, (_T("Unknown value: %s"), _deviceType.c_str())); + result = Core::ERROR_UNKNOWN_KEY; + } } - return result; + return (result); } - uint32_t DeviceInfoImplementation::DistributorId(string& value) const + Core::hresult DeviceInfoImplementation::DistributorID(string& value) const { - uint32_t result = Core::ERROR_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNAVAILABLE; if (_distributorId.empty() == false) { value = _distributorId; result = Core::ERROR_NONE; @@ -260,14 +287,18 @@ namespace Plugin { return result; } - uint32_t DeviceInfoImplementation::PlatformName(string& value) const + Core::hresult DeviceInfoImplementation::PlatformName(string& value) const { - uint32_t result = Core::ERROR_UNAVAILABLE; + Core::hresult result = Core::ERROR_UNAVAILABLE; if (_platformName.empty() == false) { value = _platformName; result = Core::ERROR_NONE; } return result; } + + Core::hresult DeviceInfoImplementation::Firmware(Exchange::IDeviceInfo::FirmwareInfo& /* value */) const { + return (Core::ERROR_UNAVAILABLE); + } } } From 52b2e8a05dd04c2a6f78e2c2b1720aa29b86b81a Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:22:22 +0200 Subject: [PATCH 5/9] Adjust the header of out of process part, inherit from IConfiguration --- DeviceInfo/DeviceInfoImplementation.h | 58 ++++++++++++++------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/DeviceInfo/DeviceInfoImplementation.h b/DeviceInfo/DeviceInfoImplementation.h index a1de13f3..b9c33f82 100644 --- a/DeviceInfo/DeviceInfoImplementation.h +++ b/DeviceInfo/DeviceInfoImplementation.h @@ -1,13 +1,15 @@ #pragma once #include "Module.h" +#include #include namespace Thunder { namespace Plugin { class DeviceInfoImplementation : public Exchange::IDeviceInfo, public Exchange::IDeviceAudioCapabilities, - public Exchange::IDeviceVideoCapabilities { + public Exchange::IDeviceVideoCapabilities, + public Exchange::IConfiguration { private: class Config : public Core::JSON::Container { using AudioCapabilitiesJsonArray = Core::JSON::ArrayType>; @@ -61,7 +63,7 @@ namespace Plugin { , Name() , Resolutions() , DefaultResolution(Exchange::IDeviceVideoCapabilities::ScreenResolution_Unknown) - , CopyProtection(Exchange::IDeviceVideoCapabilities::CopyProtection::HDCP_UNAVAILABLE) + , CopyProtection() { Add(_T("name"), &Name); Add(_T("resolutions"), &Resolutions); @@ -191,33 +193,35 @@ namespace Plugin { INTERFACE_ENTRY(Exchange::IDeviceInfo) INTERFACE_ENTRY(Exchange::IDeviceAudioCapabilities) INTERFACE_ENTRY(Exchange::IDeviceVideoCapabilities) + INTERFACE_ENTRY(Exchange::IConfiguration) END_INTERFACE_MAP - uint32_t Configure(const PluginHost::IShell* service) override; - - uint32_t AudioOutputs(IAudioOutputIterator*& res) const override; - uint32_t AudioCapabilities(const AudioOutput audioOutput, IAudioCapabilityIterator*& audioCapabilities) const override; - uint32_t MS12Capabilities(const AudioOutput audioOutput, IMS12CapabilityIterator*& ms12Capabilities) const override; - uint32_t MS12AudioProfiles(const AudioOutput audioOutput, IMS12ProfileIterator*& ms12AudioProfiles) const override; - - uint32_t VideoOutputs(IVideoOutputIterator*& videoOutputs) const override; - uint32_t DefaultResolution(const VideoOutput videoOutput, ScreenResolution& defaultResolution) const override; - uint32_t Resolutions(const VideoOutput videoOutput, IScreenResolutionIterator*& resolutions) const override; - uint32_t Hdcp(const VideoOutput videoOutput, CopyProtection& hdcpVersion) const override; - uint32_t HDR(bool& supportsHDR) const override; - uint32_t Atmos(bool& supportsAtmos) const override; - uint32_t CEC(bool& supportsCEC) const override; - uint32_t HostEDID(string& edid) const override; - - uint32_t Make(string& value) const override; - uint32_t ModelName(string& value) const override; - uint32_t ModelYear(uint16_t& value) const override; - uint32_t DeviceType(string& value) const override; - uint32_t FriendlyName(string& value) const override; - uint32_t DistributorId(string& value) const override; - uint32_t SerialNumber(string& value) const override; - uint32_t Sku(string& value) const override; - uint32_t PlatformName(string& value) const override; + uint32_t Configure(PluginHost::IShell* service) override; + + Core::hresult SerialNumber(string& value) const override; + Core::hresult ModelID(string& value) const override; + Core::hresult Make(string& value) const override; + Core::hresult ModelName(string& value) const override; + Core::hresult ModelYear(uint16_t& value) const override; + Core::hresult FriendlyName(string& value) const override; + Core::hresult DeviceType(Exchange::IDeviceInfo::Type& value) const override; + Core::hresult PlatformName(string& value) const override; + Core::hresult DistributorID(string& value) const override; + Core::hresult Firmware(Exchange::IDeviceInfo::FirmwareInfo& value) const override; + + Core::hresult AudioOutputs(Exchange::IDeviceAudioCapabilities::IAudioOutputIterator*& audioOutputs) const override; + Core::hresult AudioCapabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator*& audioCapabilities) const override; + Core::hresult MS12Capabilities(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator*& ms12Capabilities) const override; + Core::hresult MS12AudioProfiles(const Exchange::IDeviceAudioCapabilities::AudioOutput audioOutput, Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator*& ms12Profiles) const override; + + Core::hresult VideoOutputs(Exchange::IDeviceVideoCapabilities::IVideoOutputIterator*& videoOutputs) const override; + Core::hresult DefaultResolution(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::ScreenResolution& defaultResolution) const override; + Core::hresult Resolutions(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator*& resolutions) const override; + Core::hresult Hdcp(const Exchange::IDeviceVideoCapabilities::VideoOutput videoOutput, Exchange::IDeviceVideoCapabilities::CopyProtection& hdcpVersion) const override; + Core::hresult HostEDID(string& edid) const override; + Core::hresult HDR(bool& supportsHDR) const override; + Core::hresult Atmos(bool& supportsAtmos) const override; + Core::hresult CEC(bool& supportsCEC) const override; private: Config _config; From 89a78cabc0628fda7a366546cd2f1bd581458815 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:22:56 +0200 Subject: [PATCH 6/9] Remove the jsonrpc file as it is now generated from the interface --- DeviceInfo/DeviceInfoJsonRpc.cpp | 403 ------------------------------- 1 file changed, 403 deletions(-) delete mode 100644 DeviceInfo/DeviceInfoJsonRpc.cpp diff --git a/DeviceInfo/DeviceInfoJsonRpc.cpp b/DeviceInfo/DeviceInfoJsonRpc.cpp deleted file mode 100644 index 8e02d9e6..00000000 --- a/DeviceInfo/DeviceInfoJsonRpc.cpp +++ /dev/null @@ -1,403 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Module.h" -#include "DeviceInfo.h" -#include - -namespace Thunder { - -namespace Plugin { - - using namespace JsonData::DeviceInfo; - - void DeviceInfo::RegisterAll() - { - Register(_T("supportedresolutions"), &DeviceInfo::endpoint_supportedresolutions, this); - Register(_T("defaultresolution"), &DeviceInfo::endpoint_defaultresolution, this); - Register(_T("supportedhdcp"), &DeviceInfo::endpoint_supportedhdcp, this); - Register(_T("audiocapabilities"), &DeviceInfo::endpoint_audiocapabilities, this); - Register(_T("ms12capabilities"), &DeviceInfo::endpoint_ms12capabilities, this); - Register(_T("supportedms12audioprofiles"), &DeviceInfo::endpoint_supportedms12audioprofiles, this); - Property(_T("deviceaudiocapabilities"), &DeviceInfo::endpoint_get_deviceaudiocapabilities, nullptr, this); - Property(_T("devicevideocapabilities"), &DeviceInfo::endpoint_get_devicevideocapabilities, nullptr, this); - Property(_T("deviceinfo"), &DeviceInfo::endpoint_get_deviceinfo, nullptr, this); - Property(_T("systeminfo"), &DeviceInfo::endpoint_get_systeminfo, nullptr, this); - Property>(_T("addresses"), &DeviceInfo::endpoint_get_addresses, nullptr, this); - Property(_T("socketinfo"), &DeviceInfo::endpoint_get_socketinfo, nullptr, this); - Property(_T("supportedaudioports"), &DeviceInfo::endpoint_get_supportedaudioports, nullptr, this); - Property(_T("supportedvideodisplays"), &DeviceInfo::endpoint_get_supportedvideodisplays, nullptr, this); - Property(_T("hostedid"), &DeviceInfo::endpoint_get_hostedid, nullptr, this); - Property(_T("firmwareversion"), &DeviceInfo::endpoint_get_firmwareversion, nullptr, this); - Property(_T("serialnumber"), &DeviceInfo::endpoint_get_serialnumber, nullptr, this); - Property(_T("modelid"), &DeviceInfo::endpoint_get_modelid, nullptr, this); - Property(_T("make"), &DeviceInfo::endpoint_get_make, nullptr, this); - Property(_T("modelname"), &DeviceInfo::endpoint_get_modelname, nullptr, this); - Property(_T("modelyear"), &DeviceInfo::endpoint_get_modelyear, nullptr, this); - Property(_T("friendlyname"), &DeviceInfo::endpoint_get_friendlyname, nullptr, this); - Property(_T("platformname"), &DeviceInfo::endpoint_get_platformname, nullptr, this); - Property(_T("devicetype"), &DeviceInfo::endpoint_get_devicetype, nullptr, this); - Property(_T("distributorid"), &DeviceInfo::endpoint_get_distributorid, nullptr, this); - } - - void DeviceInfo::UnregisterAll() - { - Unregister(_T("supportedms12audioprofiles")); - Unregister(_T("ms12capabilities")); - Unregister(_T("audiocapabilities")); - Unregister(_T("supportedhdcp")); - Unregister(_T("defaultresolution")); - Unregister(_T("supportedresolutions")); - Unregister(_T("distributorid")); - Unregister(_T("devicetype")); - Unregister(_T("platformname")); - Unregister(_T("friendlyname")); - Unregister(_T("modelyear")); - Unregister(_T("modelname")); - Unregister(_T("make")); - Unregister(_T("modelid")); - Unregister(_T("serialnumber")); - Unregister(_T("firmwareversion")); - Unregister(_T("hostedid")); - Unregister(_T("supportedvideodisplays")); - Unregister(_T("supportedaudioports")); - Unregister(_T("socketinfo")); - Unregister(_T("addresses")); - Unregister(_T("systeminfo")); - Unregister(_T("deviceinfo")); - Unregister(_T("devicevideocapabilities")); - Unregister(_T("deviceaudiocapabilities")); - } - - // API implementation - // - - // Method: supportedresolutions - Supported resolutions on the selected video display port - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_supportedresolutions(const SupportedresolutionsParamsInfo& params, SupportedresolutionsResultData& response) - { - const VideodisplayType& videooutput = params.VideoDisplay.Value(); - return Resolutions(static_cast(videooutput), response.SupportedResolutions); - } - - // Method: defaultresolution - Default resolution on the selected video display port - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_defaultresolution(const SupportedresolutionsParamsInfo& params, DefaultresolutionResultData& response) - { - const VideodisplayType& videooutput = params.VideoDisplay.Value(); - return DefaultResolution(static_cast(videooutput), response.DefaultResolution); - } - - // Method: supportedhdcp - Supported hdcp version on the selected video display port - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_supportedhdcp(const SupportedresolutionsParamsInfo& params, SupportedhdcpResultData& response) - { - const VideodisplayType& videooutput = params.VideoDisplay.Value(); - return Hdcp(static_cast(videooutput), response.SupportedHDCPVersion); - } - - // Method: audiocapabilities - Audio capabilities for the specified audio port - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_audiocapabilities(const AudiocapabilitiesParamsInfo& params, AudiocapabilitiesResultData& response) - { - const AudioportType& audiooutput = params.AudioPort.Value(); - return AudioCapabilities(static_cast(audiooutput), response.AudioCapabilities); - } - - // Method: ms12capabilities - Audio ms12 capabilities for the specified audio port - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_ms12capabilities(const AudiocapabilitiesParamsInfo& params, Ms12capabilitiesResultData& response) - { - const AudioportType& audiooutput = params.AudioPort.Value(); - return Ms12Capabilities(static_cast(audiooutput), response.MS12Capabilities); - } - - // Method: supportedms12audioprofiles - Supported ms12 audio profiles for the specified audio port - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_supportedms12audioprofiles(const AudiocapabilitiesParamsInfo& params, Supportedms12audioprofilesResultData& response) - { - const AudioportType& audiooutput = params.AudioPort.Value(); - return Ms12Profiles(static_cast(audiooutput), response.SupportedMS12AudioProfiles); - } - - // Property: deviceaudiocapabilities - Audio capabilities of the device - // Return codes: - // - ERROR_NONE: Success - uint32_t DeviceInfo::endpoint_get_deviceaudiocapabilities(DeviceaudiocapabilitiesData& response) const - { - AudioCapabilitiesInfo(response); - return Core::ERROR_NONE; - } - - // Property: devicevideocapabilities - Video capabilities of the device - // Return codes: - // - ERROR_NONE: Success - uint32_t DeviceInfo::endpoint_get_devicevideocapabilities(DevicevideocapabilitiesData& response) const - { - VideoCapabilitiesInfo(response);; - return Core::ERROR_NONE; - } - - // Property: deviceinfo - Device meta data - // Return codes: - // - ERROR_NONE: Success - uint32_t DeviceInfo::endpoint_get_deviceinfo(DeviceinfoData& response) const - { - DeviceMetaData(response); - return Core::ERROR_NONE; - } - - // Property: systeminfo - System general information - // Return codes: - // - ERROR_NONE: Success - uint32_t DeviceInfo::endpoint_get_systeminfo(SysteminfoData& response) const - { - SysInfo(response); - return Core::ERROR_NONE; - } - - // Property: addresses - Network interface addresses - // Return codes: - // - ERROR_NONE: Success - uint32_t DeviceInfo::endpoint_get_addresses(Core::JSON::ArrayType& response) const - { - AddressInfo(response); - return Core::ERROR_NONE; - } - - // Property: socketinfo - Socket information - // Return codes: - // - ERROR_NONE: Success - uint32_t DeviceInfo::endpoint_get_socketinfo(SocketinfoData& response) const - { - SocketPortInfo(response); - return Core::ERROR_NONE; - } - - // Property: supportedaudioports - Audio ports supported on the device (all ports that are physically present) - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_supportedaudioports(SupportedaudioportsData& response) const - { - return AudioOutputs(response.SupportedAudioPorts); - } - - // Property: supportedvideodisplays - Video ports supported on the device (all ports that are physically present) - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_supportedvideodisplays(SupportedvideodisplaysData& response) const - { - return VideoOutputs(response.SupportedVideoDisplays); - } - - // Property: hostedid - EDID of the host - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_hostedid(HostedidData& response) const - { - return HostEDID(response.EDID); - } - - // Property: firmwareversion - Versions maintained in version - // Return codes: - // - ERROR_NONE: Success - // - ERROR_UNAVAILABLE: FirmwareVersion information is not available - uint32_t DeviceInfo::endpoint_get_firmwareversion(FirmwareversionData& /* response */) const - { - return Core::ERROR_UNAVAILABLE; - } - - // Property: serialnumber - Serial number set by manufacturer - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_serialnumber(SerialnumberData& response) const - { - uint32_t result = Core::ERROR_NONE; - string serialNumber; - ASSERT(_deviceInfo != nullptr); - result = _deviceInfo->SerialNumber(serialNumber); - - response.Serialnumber = serialNumber; - return result; - } - - // Property: modelid - Device model number or SKU - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_modelid(ModelidData& response) const - { - string sku; - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->Sku(sku); - if (result == Core::ERROR_NONE) { - Core::EnumerateType value(sku.c_str(), false); - if (value.IsSet()) { - response.Sku = value.Value(); - } else { - TRACE(Trace::Fatal, (_T("Unknown value %s"), sku.c_str())); - result = Core::ERROR_GENERAL; - } - } - - return result; - } - - // Property: make - Device manufacturer - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_make(MakeData& response) const - { - string make; - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->Make(make); - if (result == Core::ERROR_NONE) { - Core::EnumerateType value(make.c_str(), false); - if (value.IsSet()) { - response.Make = value.Value(); - } else { - TRACE(Trace::Fatal, (_T("Unknown value %s"), make.c_str())); - result = Core::ERROR_GENERAL; - } - } - return result; - } - - // Property: modelname - Friendly device model name - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_modelname(ModelnameData& response) const - { - string modelName; - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->ModelName(modelName); - - response.Model = modelName; - return result; - } - - // Property: modelyear - Friendly device model year - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_modelyear(ModelyearData& response) const - { - uint16_t year; - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->ModelYear(year); - response.Year = year; - - return result; - } - - // Property: friendlyname - Device friendly name - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_friendlyname(FriendlynameInfo& response) const - { - string name; - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->FriendlyName(name); - response.Name = name; - - return result; - } - - // Property: platformname - Device Platform name - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_platformname(FriendlynameInfo& response) const - { - string name; - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->PlatformName(name); - response.Name = name; - - return result; - } - - // Property: devicetype - Device type - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_devicetype(DevicetypeData& response) const - { - string deviceType; - - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->DeviceType(deviceType); - if (result == Core::ERROR_NONE) { - Core::EnumerateType value(deviceType.c_str(), false); - if (value.IsSet()) { - response.Devicetype = value.Value(); - } else { - TRACE(Trace::Fatal, (_T("Unknown value %s"), deviceType.c_str())); - result = Core::ERROR_GENERAL; - } - } - - return result; - } - - // Property: distributorid - Partner ID or distributor ID for device - // Return codes: - // - ERROR_NONE: Success - // - ERROR_GENERAL: - uint32_t DeviceInfo::endpoint_get_distributorid(DistributoridData& response) const - { - string distributorId; - - ASSERT(_deviceInfo != nullptr); - uint32_t result = _deviceInfo->DistributorId(distributorId); - if (result == Core::ERROR_NONE) { - Core::EnumerateType value(distributorId.c_str(), false); - if (value.IsSet()) { - response.Distributorid = value.Value(); - } else { - TRACE(Trace::Fatal, (_T("Unknown value %s"), distributorId.c_str())); - result = Core::ERROR_GENERAL; - } - } - - return result; - } - -} // namespace Plugin - -} From 9951024dc50ec20a76ee17581559738a7d39699c Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:23:34 +0200 Subject: [PATCH 7/9] Make sure the documentation is now properly generated from the new json-rpc compatible interface --- DeviceInfo/DeviceInfoPlugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeviceInfo/DeviceInfoPlugin.json b/DeviceInfo/DeviceInfoPlugin.json index 080697c3..b8e60b27 100644 --- a/DeviceInfo/DeviceInfoPlugin.json +++ b/DeviceInfo/DeviceInfoPlugin.json @@ -88,6 +88,6 @@ ] }, "interface": { - "$ref": "{interfacedir}/DeviceInfo.json#" + "$ref": "{cppinterfacedir}/IDeviceInfo.h" } } \ No newline at end of file From 6189eac7aecc2ecdf630f42cee9c78005e11a2a6 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:24:32 +0200 Subject: [PATCH 8/9] Generate the new doc for the changed interface --- DeviceInfo/doc/DeviceInfoPlugin.md | 1285 +++++++++++++++------------- 1 file changed, 709 insertions(+), 576 deletions(-) diff --git a/DeviceInfo/doc/DeviceInfoPlugin.md b/DeviceInfo/doc/DeviceInfoPlugin.md index b321e233..74d9d1fa 100644 --- a/DeviceInfo/doc/DeviceInfoPlugin.md +++ b/DeviceInfo/doc/DeviceInfoPlugin.md @@ -1,5 +1,5 @@ - + # Device Info Plugin **Version: 1.0** @@ -10,27 +10,27 @@ DeviceInfo plugin for Thunder framework. ### Table of Contents -- [Introduction](#head.Introduction) -- [Description](#head.Description) -- [Configuration](#head.Configuration) -- [Interfaces](#head.Interfaces) -- [Methods](#head.Methods) -- [Properties](#head.Properties) +- [Introduction](#head_Introduction) +- [Description](#head_Description) +- [Configuration](#head_Configuration) +- [Interfaces](#head_Interfaces) +- [Methods](#head_Methods) +- [Properties](#head_Properties) - + # Introduction - + ## Scope This document describes purpose and functionality of the DeviceInfo plugin. It includes detailed specification about its configuration, methods and properties provided. - + ## Case Sensitivity All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such. - + ## Acronyms, Abbreviations and Terms The table below provides and overview of acronyms used in this document and their definitions. @@ -48,7 +48,7 @@ The table below provides and overview of terms and abbreviations used in this do | :-------- | :-------- | | callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. | - + ## References | Ref ID | Description | @@ -58,14 +58,14 @@ The table below provides and overview of terms and abbreviations used in this do | [JSON](http://www.json.org/) | JSON specification | | [Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20Thunder.docx) | Thunder API Reference | - + # Description The DeviceInfo plugin allows retrieving of various device-related information. The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. @@ -92,317 +92,611 @@ The table below lists configuration options of the plugin. | systemIntegratorName | string | mandatory | System Integrator Name | | platformName | string | mandatory | Platform Name | - + # Interfaces This plugin implements the following interfaces: -- [DeviceInfo.json](https://github.com/rdkcentral/ThunderInterfaces/blob/master/jsonrpc/DeviceInfo.json) (version 1.0.0) (uncompliant-extended format) +- IDeviceInfo ([IDeviceInfo.h](https://github.com/rdkcentral/ThunderInterfaces/blob/master/interfaces/IDeviceInfo.h)) (version 1.0.0) (compliant format) +> This interface uses legacy ```lowercase``` naming convention. With the next major release the naming convention will change to ```camelCase```. - +- IDeviceAudioCapabilities ([IDeviceInfo.h](https://github.com/rdkcentral/ThunderInterfaces/blob/master/interfaces/IDeviceInfo.h)) (version 1.0.0) (compliant format) +> This interface uses legacy ```lowercase``` naming convention. With the next major release the naming convention will change to ```camelCase```. + +- IDeviceVideoCapabilities ([IDeviceInfo.h](https://github.com/rdkcentral/ThunderInterfaces/blob/master/interfaces/IDeviceInfo.h)) (version 1.0.0) (compliant format) +> This interface uses legacy ```lowercase``` naming convention. With the next major release the naming convention will change to ```camelCase```. + +- ISystemInfo ([IDeviceInfo.h](https://github.com/rdkcentral/ThunderInterfaces/blob/master/interfaces/IDeviceInfo.h)) (version 1.0.0) (compliant format) +> This interface uses legacy ```lowercase``` naming convention. With the next major release the naming convention will change to ```camelCase```. + + # Methods The following methods are provided by the DeviceInfo plugin: -DeviceInfo interface methods: +DeviceVideoCapabilities interface methods: | Method | Description | | :-------- | :-------- | -| [supportedresolutions](#method.supportedresolutions) | Supported resolutions on the selected video display port | -| [defaultresolution](#method.defaultresolution) | Default resolution on the selected video display port | -| [supportedhdcp](#method.supportedhdcp) | Supported hdcp version on the selected video display port | -| [audiocapabilities](#method.audiocapabilities) | Audio capabilities for the specified audio port | -| [ms12capabilities](#method.ms12capabilities) | Audio ms12 capabilities for the specified audio port | -| [supportedms12audioprofiles](#method.supportedms12audioprofiles) | Supported ms12 audio profiles for the specified audio port | +| [hdr](#method_hdr) | HDR support by this device | - -## *supportedresolutions [method](#head.Methods)* + +## *hdr [method](#head_Methods)* -Supported resolutions on the selected video display port. +HDR support by this device. ### Parameters +This method takes no parameters. + +### Result + | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| params | object | mandatory | *...* | -| params.videoDisplay | string | mandatory | Video output supported by the device (must be one of the following: *COMPONET, COMPOSITE, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SCART_RGB, SVIDEO*) | +| result | boolean | mandatory | True if device supports HDR, false otherwise | -### Result +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.hdr" +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": false +} +``` + + +# Properties + +The following properties are provided by the DeviceInfo plugin: + +DeviceInfo interface properties: + +| Property | R/W | Description | +| :-------- | :-------- | :-------- | +| [serialnumber](#property_serialnumber) | read-only | Device serial number | +| [modelid](#property_modelid) | read-only | Device model number or stock keeping unit (SKU) | +| [make](#property_make) | read-only | Device manufacturer | +| [modelname](#property_modelname) | read-only | Device model name | +| [modelyear](#property_modelyear) | read-only | Device model year | +| [friendlyname](#property_friendlyname) | read-only | Device friendly name | +| [devicetype](#property_devicetype) | read-only | Device type | +| [platformname](#property_platformname) | read-only | Device platform name | +| [distributorid](#property_distributorid) | read-only | Partner ID or distributor ID for device | +| [firmware](#property_firmware) / [firmwareversion](#property_firmware) | read-only | Versions maintained in version | + +DeviceAudioCapabilities interface properties: + +| Property | R/W | Description | +| :-------- | :-------- | :-------- | +| [audiooutputs](#property_audiooutputs) / [supportedaudioports](#property_audiooutputs) | read-only | Audio ports supported on the device (all ports that are physically present | +| [audiocapabilities](#property_audiocapabilities) | read-only | Audio capabilities for the specified audio port | +| [ms12capabilities](#property_ms12capabilities) | read-only | Audio ms12 capabilities for the specified audio port | +| [ms12audioprofiles](#property_ms12audioprofiles) / [supportedms12audioprofiles](#property_ms12audioprofiles) | read-only | Audio ms12 profiles for the specified audio port | + +DeviceVideoCapabilities interface properties: + +| Property | R/W | Description | +| :-------- | :-------- | :-------- | +| [videooutputs](#property_videooutputs) / [supportedvideoports](#property_videooutputs) | read-only | Video ports supported on the device (all ports that are physically present) | +| [defaultresolution](#property_defaultresolution) | read-only | Default resolution for the specified video output | +| [resolutions](#property_resolutions) / [supportedresolutions](#property_resolutions) | read-only | Resolutions supported by the specified video output | +| [hdcp](#property_hdcp) / [supportedhdcp](#property_hdcp) | read-only | High-bandwidth Digital Content Protection (HDCP) supported by the specified video output | +| [hostedid](#property_hostedid) | read-only | Extended Display Identification Data (EDID) of the host | +| [atmos](#property_atmos) | read-only | Atmos support by this device | +| [cec](#property_cec) | read-only | CEC support by this device | + +SystemInfo interface properties: + +| Property | R/W | Description | +| :-------- | :-------- | :-------- | +| [version](#property_version) | read-only | Software version (in form *version#hashtag*) param value: Software version of the device | +| [uptime](#property_uptime) | read-only | System uptime (in seconds) param value: System uptime in seconds | +| [totalram](#property_totalram) | read-only | Total installed system RAM (in bytes) param value: Total installed system RAM in bytes | +| [freeram](#property_freeram) | read-only | Free system RAM (in bytes) param value: System RAM still available in bytes | +| [totalswap](#property_totalswap) | read-only | Total swap space (in bytes) param value: Total swap space in bytes | +| [freeswap](#property_freeswap) | read-only | Free swap space (in bytes) param value: Swap space still available in bytes | +| [devicename](#property_devicename) | read-only | Host name param value: Host name of the device | +| [cpuload](#property_cpuload) | read-only | Current CPU load (percentage) param value: Current CPU load in percentage | +| [cpuloadavgs](#property_cpuloadavgs) | read-only | CPU load averages from 1, 5 and 15 minutes (percentage) param value: An array of three CPU load averages in percentage | +| [addresses](#property_addresses) | read-only | Network interface addresses | +| [socketinfo](#property_socketinfo) | read-only | Socket information | + + +## *serialnumber [property](#head_Properties)* + +Provides access to the device serial number. + +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | *...* | -| result.supportedResolutions | array | mandatory | An array of resolution supported by the device | -| result.supportedResolutions[#] | string | mandatory | Resolution supported by the device (must be one of the following: *1080i, 1080i25, 1080i50, 1080i60, 1080p, 1080p24, 1080p25, 1080p30, 1080p50, 1080p60, 2160p24, 2160p25, 2160p30, 2160p50, 2160p60, 4320p30, 4320p60, 480i, 480p, 576i, 576p, 576p50, 720p, 720p24, 720p25, 720p30, 720p50, 720p60, unknown*) | +| (property) | string | mandatory | Serial number set by manufacturer | ### Errors | Message | Description | | :-------- | :-------- | -| ```ERROR_GENERAL``` | general error | +| ```ERROR_UNAVAILABLE``` | Information about the serial number of the device is not available | ### Example -#### Request +#### Get Request ```json { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.supportedresolutions", - "params": { - "videoDisplay": "displayport" - } + "method": "DeviceInfo.1.serialnumber" } ``` -#### Response +#### Get Response ```json { "jsonrpc": "2.0", "id": 42, - "result": { - "supportedResolutions": [ - "1080p" - ] - } + "result": "PAW400003744" } ``` - -## *defaultresolution [method](#head.Methods)* + +## *modelid [property](#head_Properties)* -Default resolution on the selected video display port. +Provides access to the device model number or stock keeping unit (SKU). -### Parameters +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| params | object | mandatory | *...* | -| params.videoDisplay | string | mandatory | Video output supported by the device (must be one of the following: *COMPONET, COMPOSITE, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SCART_RGB, SVIDEO*) | +| (property) | string | mandatory | Model number or SKU of the device | -### Result +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_UNAVAILABLE``` | Information about the model number or SKU of the device is not available | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.modelid" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "PX051AEI" +} +``` + + +## *make [property](#head_Properties)* + +Provides access to the device manufacturer. + +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | *...* | -| result.defaultResolution | string | mandatory | Resolution supported by the device (must be one of the following: *1080i, 1080i25, 1080i50, 1080i60, 1080p, 1080p24, 1080p25, 1080p30, 1080p50, 1080p60, 2160p24, 2160p25, 2160p30, 2160p50, 2160p60, 4320p30, 4320p60, 480i, 480p, 576i, 576p, 576p50, 720p, 720p24, 720p25, 720p30, 720p50, 720p60, unknown*) | +| (property) | string | mandatory | Manufacturer of the device | ### Errors | Message | Description | | :-------- | :-------- | -| ```ERROR_GENERAL``` | general error | +| ```ERROR_UNAVAILABLE``` | Information about the manufacturer of the device is not available | ### Example -#### Request +#### Get Request ```json { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.defaultresolution", - "params": { - "videoDisplay": "displayport" - } + "method": "DeviceInfo.1.make" } ``` -#### Response +#### Get Response ```json { "jsonrpc": "2.0", "id": 42, - "result": { - "defaultResolution": "1080p" - } + "result": "pace" } ``` - -## *supportedhdcp [method](#head.Methods)* + +## *modelname [property](#head_Properties)* -Supported hdcp version on the selected video display port. +Provides access to the device model name. -### Parameters +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| params | object | mandatory | *...* | -| params.videoDisplay | string | mandatory | Video output supported by the device (must be one of the following: *COMPONET, COMPOSITE, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SCART_RGB, SVIDEO*) | +| (property) | string | mandatory | Model name of the device | -### Result +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.modelname" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "Pace Xi5" +} +``` + + +## *modelyear [property](#head_Properties)* + +Provides access to the device model year. + +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | *...* | -| result.supportedHDCPVersion | string | mandatory | HDCP support (must be one of the following: *1.4, 2.0, 2.1, 2.2, unavailable*) | +| (property) | integer | mandatory | Year of the model | ### Errors | Message | Description | | :-------- | :-------- | -| ```ERROR_GENERAL``` | general error | +| ```ERROR_UNAVAILABLE``` | Information about the model year of the device is not available | ### Example -#### Request +#### Get Request ```json { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.supportedhdcp", - "params": { - "videoDisplay": "displayport" - } + "method": "DeviceInfo.1.modelyear" } ``` -#### Response +#### Get Response ```json { "jsonrpc": "2.0", "id": 42, - "result": { - "supportedHDCPVersion": "hdcp_20" - } + "result": 2020 } ``` - -## *audiocapabilities [method](#head.Methods)* + +## *friendlyname [property](#head_Properties)* -Audio capabilities for the specified audio port. +Provides access to the device friendly name. -### Parameters +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| params | object | mandatory | *...* | -| params.audioPort | string | mandatory | Audio output supported by the device (must be one of the following: *ANALOG, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SPDIF0*) | +| (property) | string | mandatory | Friendly name of the device | -### Result +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_UNAVAILABLE``` | Information about the friendly name of the device is not available | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.friendlyname" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "My Device" +} +``` + + +## *devicetype [property](#head_Properties)* + +Provides access to the device type. + +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | *...* | -| result.AudioCapabilities | array | mandatory | An array of audio capabilities | -| result.AudioCapabilities[#] | string | mandatory | Audio capability (must be one of the following: *ATMOS, DAPv2, DOLBY DIGITAL, DOLBY DIGITAL PLUS, Dual Audio Decode, MS12, none*) | +| (property) | string | mandatory | Type of the device (must be one of the following: *Hybrid, IpStb, MediaClient, QamIpStb, Tv*) | ### Errors | Message | Description | | :-------- | :-------- | -| ```ERROR_GENERAL``` | general error | +| ```ERROR_UNAVAILABLE``` | Information about a type of the device is not available | +| ```ERROR_UNKNOWN_KEY``` | The device type is not recognized | ### Example -#### Request +#### Get Request ```json { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.audiocapabilities", - "params": { - "audioPort": "analog" - } + "method": "DeviceInfo.1.devicetype" } ``` -#### Response +#### Get Response ```json { "jsonrpc": "2.0", "id": 42, - "result": { - "AudioCapabilities": [ - "none" - ] - } + "result": "IP_STB" } ``` - -## *ms12capabilities [method](#head.Methods)* + +## *platformname [property](#head_Properties)* -Audio ms12 capabilities for the specified audio port. +Provides access to the device platform name. -### Parameters +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| params | object | mandatory | *...* | -| params.audioPort | string | mandatory | Audio output supported by the device (must be one of the following: *ANALOG, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SPDIF0*) | +| (property) | string | mandatory | Platform name of the device | -### Result +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_UNAVAILABLE``` | Information about the platform name of the device is not available | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.platformname" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "Linux" +} +``` + + +## *distributorid [property](#head_Properties)* + +Provides access to the partner ID or distributor ID for device. + +> This property is **read-only**. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | *...* | -| result.MS12Capabilities | array | mandatory | An array of MS12 audio capabilities | -| result.MS12Capabilities[#] | string | mandatory | MS12 audio capability (must be one of the following: *Dialogue Enhancer, Dolby Volume, Inteligent Equalizer, none*) | +| (property) | string | mandatory | Partner ID or distributor ID for device | ### Errors | Message | Description | | :-------- | :-------- | -| ```ERROR_GENERAL``` | general error | +| ```ERROR_UNAVAILABLE``` | Information about the distributor ID of the device is not available | ### Example -#### Request +#### Get Request ```json { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.ms12capabilities", - "params": { - "audioPort": "analog" - } + "method": "DeviceInfo.1.distributorid" } ``` -#### Response +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "Comcast" +} +``` + + +## *firmware [property](#head_Properties)* + +Provides access to the versions maintained in version.txt. + +> This property is **read-only**. + +> ``firmwareversion`` is an alternative name for this property. This name is **deprecated** and may be removed in the future. It is not recommended for use in new implementations. + +### Value + +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| (property) | object | mandatory | Name of the firmware image and its specific versions | +| (property).imagename | string | mandatory | Name of firmware image | +| (property)?.sdk | string | optional | SDK version string | +| (property)?.mediarite | string | optional | Mediarite value | +| (property)?.build | string | optional | Yocto version | + +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_UNAVAILABLE``` | Information about the firmware version is not available | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.firmware" +} +``` + +#### Get Response ```json { "jsonrpc": "2.0", "id": 42, "result": { - "MS12Capabilities": [ - "dolby_volume" - ] + "imagename": "PX051AEI_VBN_2203_sprint_20220331225312sdy_NG", + "sdk": "17.3", + "mediarite": "8.3.53", + "build": "dunfell" } } ``` - -## *supportedms12audioprofiles [method](#head.Methods)* + +## *audiooutputs [property](#head_Properties)* -Supported ms12 audio profiles for the specified audio port. +Provides access to the audio ports supported on the device (all ports that are physically present. -### Parameters +> This property is **read-only**. + +> ``supportedaudioports`` is an alternative name for this property. This name is **deprecated** and may be removed in the future. It is not recommended for use in new implementations. + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| params | object | mandatory | *...* | -| params.audioPort | string | mandatory | Audio output supported by the device (must be one of the following: *ANALOG, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SPDIF0*) | +| (property) | array | mandatory | An array of audio outputs supported by the device | +| (property)[#] | string | mandatory | *...* (must be one of the following: *Analog, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, Spdif*) | -### Result +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_GENERAL``` | General error | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.audiooutputs" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": [ + "RfModulator" + ] +} +``` + + +## *audiocapabilities [property](#head_Properties)* + +Provides access to the audio capabilities for the specified audio port. + +> This property is **read-only**. + +> The *audiooutput* parameter shall be passed as the index to the property, i.e. ``audiocapabilities@``. + +### Index | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | *...* | -| result.supportedMS12AudioProfiles | array | mandatory | An array of ms12 audio profiles | -| result.supportedMS12AudioProfiles[#] | string | mandatory | MS12 Profile (must be one of the following: *Movie, Music, None, Voice*) | +| audiooutput | string | mandatory | Audio output supported by the device (must be one of the following: *Analog, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, Spdif*) | + +### Value + +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| (property) | array | mandatory | An array of audio capabilities supported by specified port | +| (property)[#] | string | mandatory | *...* (must be one of the following: *Atmos, Dad, DapV2, Dd, DdPlus, Ms12*) | ### Errors @@ -412,85 +706,109 @@ Supported ms12 audio profiles for the specified audio port. ### Example -#### Request +#### Get Request ```json { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.supportedms12audioprofiles", - "params": { - "audioPort": "analog" - } + "method": "DeviceInfo.1.audiocapabilities@xyz" } ``` -#### Response +#### Get Response ```json { "jsonrpc": "2.0", "id": 42, - "result": { - "supportedMS12AudioProfiles": [ - "music" - ] - } + "result": [ + "Dd" + ] +} +``` + + +## *ms12capabilities [property](#head_Properties)* + +Provides access to the audio ms12 capabilities for the specified audio port. + +> This property is **read-only**. + +> The *audiooutput* parameter shall be passed as the index to the property, i.e. ``ms12capabilities@``. + +### Index + +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| audiooutput | string | mandatory | Audio output supported by the device (must be one of the following: *Analog, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, Spdif*) | + +### Value + +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| (property) | array | mandatory | An array of MS12 audio capabilities supported by specified port | +| (property)[#] | string | mandatory | *...* (must be one of the following: *DialogueEnhancer, DolbyVolume, InteligentEqualizer*) | + +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_GENERAL``` | General error | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceInfo.1.ms12capabilities@xyz" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": [ + "InteligentEqualizer" + ] } ``` - -# Properties + +## *ms12audioprofiles [property](#head_Properties)* -The following properties are provided by the DeviceInfo plugin: +Provides access to the audio ms12 profiles for the specified audio port. -DeviceInfo interface properties: +> This property is **read-only**. -| Property | R/W | Description | -| :-------- | :-------- | :-------- | -| [deviceaudiocapabilities](#property.deviceaudiocapabilities) | read-only | Audio capabilities of the device | -| [devicevideocapabilities](#property.devicevideocapabilities) | read-only | Video capabilities of the device | -| [deviceinfo](#property.deviceinfo) | read-only | Device meta data | -| [systeminfo](#property.systeminfo) | read-only | System general information | -| [addresses](#property.addresses) | read-only | Network interface addresses | -| [socketinfo](#property.socketinfo) | read-only | Socket information | -| [supportedaudioports](#property.supportedaudioports) | read-only | Audio ports supported on the device (all ports that are physically present) | -| [supportedvideodisplays](#property.supportedvideodisplays) | read-only | Video ports supported on the device (all ports that are physically present) | -| [hostedid](#property.hostedid) | read-only | EDID of the host | -| [firmwareversion](#property.firmwareversion) | read-only | Versions maintained in version | -| [serialnumber](#property.serialnumber) | read-only | Serial number set by manufacturer | -| [make](#property.make) | read-only | Device manufacturer | -| [modelid](#property.modelid) | read-only | Device model number or SKU | -| [modelname](#property.modelname) | read-only | Device model name | -| [modelyear](#property.modelyear) | read-only | Device model year | -| [friendlyname](#property.friendlyname) | read-only | Device friendly name | -| [platformname](#property.platformname) | read-only | Device Platform name | -| [devicetype](#property.devicetype) | read-only | Device type | -| [distributorid](#property.distributorid) | read-only | Partner ID or distributor ID for device | - - -## *deviceaudiocapabilities [property](#head.Properties)* - -Provides access to the audio capabilities of the device. +> ``supportedms12audioprofiles`` is an alternative name for this property. This name is **deprecated** and may be removed in the future. It is not recommended for use in new implementations. -> This property is **read-only**. +> The *audiooutput* parameter shall be passed as the index to the property, i.e. ``ms12audioprofiles@``. -### Value +### Index -### Result +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| audiooutput | string | mandatory | Audio output supported by the device (must be one of the following: *Analog, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, Spdif*) | + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Audio capabilities of the device | -| result.audiooutputcapabilities | array | mandatory | An array of audiooutputcapabilities | -| result.audiooutputcapabilities[#] | object | mandatory | Audio capabilities of the output | -| result.audiooutputcapabilities[#]?.audioPort | string | optional | Audio Output support (must be one of the following: *ANALOG, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SPDIF0*) | -| result.audiooutputcapabilities[#].audiocapabilities | array | mandatory | Audio capabilities for the specified audio port | -| result.audiooutputcapabilities[#].audiocapabilities[#] | string | mandatory | Audio capability (must be one of the following: *ATMOS, DAPv2, DOLBY DIGITAL, DOLBY DIGITAL PLUS, Dual Audio Decode, MS12, none*) | -| result.audiooutputcapabilities[#].ms12capabilities | array | mandatory | Audio ms12 capabilities for the specified audio port | -| result.audiooutputcapabilities[#].ms12capabilities[#] | string | mandatory | MS12 audio capability (must be one of the following: *Dialogue Enhancer, Dolby Volume, Inteligent Equalizer, none*) | -| result.audiooutputcapabilities[#].ms12profiles | array | mandatory | Audio ms12 profiles for the specified audio port | -| result.audiooutputcapabilities[#].ms12profiles[#] | string | mandatory | MS12 Profile (must be one of the following: *Movie, Music, None, Voice*) | +| (property) | array | mandatory | An array of MS12 audio profiles supported by specified port | +| (property)[#] | string | mandatory | *...* (must be one of the following: *Movie, Music, Voice*) | + +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_GENERAL``` | General error | ### Example @@ -500,7 +818,7 @@ Provides access to the audio capabilities of the device. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.deviceaudiocapabilities" + "method": "DeviceInfo.1.ms12audioprofiles@xyz" } ``` @@ -510,50 +828,33 @@ Provides access to the audio capabilities of the device. { "jsonrpc": "2.0", "id": 42, - "result": { - "audiooutputcapabilities": [ - { - "audioPort": "analog", - "audiocapabilities": [ - "none" - ], - "ms12capabilities": [ - "dolby_volume" - ], - "ms12profiles": [ - "music" - ] - } - ] - } + "result": [ + "Movie" + ] } ``` - -## *devicevideocapabilities [property](#head.Properties)* + +## *videooutputs [property](#head_Properties)* -Provides access to the video capabilities of the device. +Provides access to the video ports supported on the device (all ports that are physically present). > This property is **read-only**. -### Value +> ``supportedvideoports`` is an alternative name for this property. This name is **deprecated** and may be removed in the future. It is not recommended for use in new implementations. -### Result +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Video capabilities of the device | -| result.hostedid | string | mandatory | EDID of the host | -| result.hdr | boolean | mandatory | Is HDR supported by this device | -| result.atmos | boolean | mandatory | Is Atmos supported by this device | -| result.cec | boolean | mandatory | Is CEC supported by this device | -| result.videooutputcapabilities | array | mandatory | An array of videooutputcapabilities | -| result.videooutputcapabilities[#] | object | mandatory | Video capabilities of the output | -| result.videooutputcapabilities[#].hdcp | string | mandatory | HDCP support (must be one of the following: *1.4, 2.0, 2.1, 2.2, unavailable*) | -| result.videooutputcapabilities[#]?.videoDisplay | string | optional | Video Output support (must be one of the following: *COMPONET, COMPOSITE, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SCART_RGB, SVIDEO*) | -| result.videooutputcapabilities[#].output_resolutions | array | mandatory | Supported resolutions | -| result.videooutputcapabilities[#].output_resolutions[#] | string | mandatory | Resolution supported by the device (must be one of the following: *1080i, 1080i25, 1080i50, 1080i60, 1080p, 1080p24, 1080p25, 1080p30, 1080p50, 1080p60, 2160p24, 2160p25, 2160p30, 2160p50, 2160p60, 4320p30, 4320p60, 480i, 480p, 576i, 576p, 576p50, 720p, 720p24, 720p25, 720p30, 720p50, 720p60, unknown*) | -| result.videooutputcapabilities[#].defaultresolution | string | mandatory | Default resolution (must be one of the following: *1080i, 1080i25, 1080i50, 1080i60, 1080p, 1080p24, 1080p25, 1080p30, 1080p50, 1080p60, 2160p24, 2160p25, 2160p30, 2160p50, 2160p60, 4320p30, 4320p60, 480i, 480p, 576i, 576p, 576p50, 720p, 720p24, 720p25, 720p30, 720p50, 720p60, unknown*) | +| (property) | array | mandatory | An array of video outputs supported by the device | +| (property)[#] | string | mandatory | *...* (must be one of the following: *Component, Composite, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, SVideo, ScartRgb*) | + +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_GENERAL``` | General error | ### Example @@ -563,7 +864,7 @@ Provides access to the video capabilities of the device. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.devicevideocapabilities" + "method": "DeviceInfo.1.videooutputs" } ``` @@ -573,48 +874,38 @@ Provides access to the video capabilities of the device. { "jsonrpc": "2.0", "id": 42, - "result": { - "hostedid": "...", - "hdr": false, - "atmos": false, - "cec": true, - "videooutputcapabilities": [ - { - "hdcp": "hdcp_20", - "videoDisplay": "displayport", - "output_resolutions": [ - "1080p" - ], - "defaultresolution": "1080p" - } - ] - } + "result": [ + "RfModulator" + ] } ``` - -## *deviceinfo [property](#head.Properties)* + +## *defaultresolution [property](#head_Properties)* -Provides access to the device meta data. +Provides access to the default resolution for the specified video output. > This property is **read-only**. -### Value +> The *videooutput* parameter shall be passed as the index to the property, i.e. ``defaultresolution@``. -### Result +### Index + +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| videooutput | string | mandatory | Video output supported by the device (must be one of the following: *Component, Composite, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, SVideo, ScartRgb*) | + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device meta data | -| result?.devicetype | string | optional | Device type | -| result?.friendlyname | string | optional | Friendly name | -| result?.distributorid | string | optional | Partner ID or distributor ID for device | -| result?.make | string | optional | Device manufacturer | -| result?.modelname | string | optional | Model Name | -| result?.modelyear | integer | optional | Model Year | -| result?.platformname | string | optional | Platform name | -| result?.serialnumber | string | optional | Device serial number | -| result?.sku | string | optional | Device model number or SKU | +| (property) | string | mandatory | Default resolution supported by specified port (must be one of the following: *ScreenResolution1080i, ScreenResolution1080i25hz, ScreenResolution1080i50hz, ScreenResolution1080p, ScreenResolution1080p24hz, ScreenResolution1080p25hz, ScreenResolution1080p30hz, ScreenResolution1080p50hz, ScreenResolution1080p60hz, ScreenResolution2160p30hz, ScreenResolution2160p50hz, ScreenResolution2160p60hz, ScreenResolution4320p30hz, ScreenResolution4320p60hz, ScreenResolution480i, ScreenResolution480p, ScreenResolution576i, ScreenResolution576p, ScreenResolution576p50hz, ScreenResolution720p, ScreenResolution720p50hz, ScreenResolutionUnknown*) | + +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_UNKNOWN_KEY``` | Provided video output is not recognized | ### Example @@ -624,7 +915,7 @@ Provides access to the device meta data. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.deviceinfo" + "method": "DeviceInfo.1.defaultresolution@xyz" } ``` @@ -634,48 +925,40 @@ Provides access to the device meta data. { "jsonrpc": "2.0", "id": 42, - "result": { - "devicetype": "IpStb", - "friendlyname": "my device", - "distributorid": "Comcast", - "make": "pace", - "modelname": "model A", - "modelyear": 2020, - "platformname": "linux", - "serialnumber": "WPEuCfrLF45", - "sku": "PX051AEI" - } + "result": "ScreenResolution480i" } ``` - -## *systeminfo [property](#head.Properties)* + +## *resolutions [property](#head_Properties)* -Provides access to the system general information. +Provides access to the resolutions supported by the specified video output. > This property is **read-only**. -### Value +> ``supportedresolutions`` is an alternative name for this property. This name is **deprecated** and may be removed in the future. It is not recommended for use in new implementations. -### Result +> The *videooutput* parameter shall be passed as the index to the property, i.e. ``resolutions@``. + +### Index | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | System general information | -| result.version | string | mandatory | Software version (in form *version#hashtag*) | -| result.uptime | integer | mandatory | System uptime (in seconds) | -| result.totalram | integer | mandatory | Total installed system RAM memory (in bytes) | -| result.freeram | integer | mandatory | Free system RAM memory (in bytes) | -| result.totalswap | integer | mandatory | Total swap space (in bytes) | -| result.freeswap | integer | mandatory | Swap space still available (in bytes) | -| result.devicename | string | mandatory | Host name | -| result.cpuload | string | mandatory | Current CPU load (percentage) | -| result.cpuloadavg | object | mandatory | CPU load average | -| result.cpuloadavg.avg1min | integer | mandatory | 1min cpuload average | -| result.cpuloadavg.avg5min | integer | mandatory | 5min cpuload average | -| result.cpuloadavg.avg15min | integer | mandatory | 15min cpuload average | -| result.serialnumber | string | mandatory | Device serial number | -| result.time | string | mandatory | Current system date and time | +| videooutput | string | mandatory | Video output supported by the device (must be one of the following: *Component, Composite, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, SVideo, ScartRgb*) | + +### Value + +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| (property) | array | mandatory | An array of resolutions supported by specified port | +| (property)[#] | string | mandatory | *...* (must be one of the following: *ScreenResolution1080i, ScreenResolution1080i25hz, ScreenResolution1080i50hz, ScreenResolution1080p, ScreenResolution1080p24hz, ScreenResolution1080p25hz, ScreenResolution1080p30hz, ScreenResolution1080p50hz, ScreenResolution1080p60hz, ScreenResolution2160p30hz, ScreenResolution2160p50hz, ScreenResolution2160p60hz, ScreenResolution4320p30hz, ScreenResolution4320p60hz, ScreenResolution480i, ScreenResolution480p, ScreenResolution576i, ScreenResolution576p, ScreenResolution576p50hz, ScreenResolution720p, ScreenResolution720p50hz, ScreenResolutionUnknown*) | + +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_UNKNOWN_KEY``` | Provided video output is not recognized | +| ```ERROR_GENERAL``` | General error | ### Example @@ -685,7 +968,7 @@ Provides access to the system general information. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.systeminfo" + "method": "DeviceInfo.1.resolutions@xyz" } ``` @@ -695,45 +978,40 @@ Provides access to the system general information. { "jsonrpc": "2.0", "id": 42, - "result": { - "version": "1.0#14452f612c3747645d54974255d11b8f3b4faa54", - "uptime": 120, - "totalram": 655757312, - "freeram": 563015680, - "totalswap": 789132680, - "freeswap": 789132680, - "devicename": "buildroot", - "cpuload": "2", - "cpuloadavg": { - "avg1min": 789132680, - "avg5min": 789132680, - "avg15min": 789132680 - }, - "serialnumber": "WPEuCfrLF45", - "time": "Mon, 11 Mar 2019 14:38:18" - } + "result": [ + "ScreenResolution480i" + ] } ``` - -## *addresses [property](#head.Properties)* + +## *hdcp [property](#head_Properties)* -Provides access to the network interface addresses. +Provides access to the high-bandwidth Digital Content Protection (HDCP) supported by the specified video output. > This property is **read-only**. -### Value +> ``supportedhdcp`` is an alternative name for this property. This name is **deprecated** and may be removed in the future. It is not recommended for use in new implementations. -### Result +> The *videooutput* parameter shall be passed as the index to the property, i.e. ``hdcp@``. + +### Index + +| Name | Type | M/O | Description | +| :-------- | :-------- | :-------- | :-------- | +| videooutput | string | mandatory | Video output supported by the device (must be one of the following: *Component, Composite, DisplayPort, Hdmi0, Hdmi1, Other, RfModulator, SVideo, ScartRgb*) | + +### Value | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | array | mandatory | Network interface addresses | -| result[#] | object | mandatory | *...* | -| result[#].name | string | mandatory | Interface name | -| result[#].mac | string | mandatory | Interface MAC address | -| result[#]?.ip | array | optional | An array of Interface IP address | -| result[#]?.ip[#] | string | optional | Interface IP address | +| (property) | string | mandatory | HDCP version supported by specified port (must be one of the following: *Hdcp14, Hdcp20, Hdcp21, Hdcp22*) | + +### Errors + +| Message | Description | +| :-------- | :-------- | +| ```ERROR_UNKNOWN_KEY``` | Provided video output is not recognized | ### Example @@ -743,7 +1021,7 @@ Provides access to the network interface addresses. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.addresses" + "method": "DeviceInfo.1.hdcp@xyz" } ``` @@ -753,38 +1031,22 @@ Provides access to the network interface addresses. { "jsonrpc": "2.0", "id": 42, - "result": [ - { - "name": "lo", - "mac": "00:00:00:00:00", - "ip": [ - "127.0.0.1" - ] - } - ] + "result": "Hdcp20" } ``` - -## *socketinfo [property](#head.Properties)* + +## *hostedid [property](#head_Properties)* -Provides access to the socket information. +Provides access to the extended Display Identification Data (EDID) of the host. > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Socket information | -| result?.total | integer | optional | Number of total | -| result?.open | integer | optional | Number of open | -| result?.link | integer | optional | Number of link | -| result?.exception | integer | optional | Number of exception | -| result?.shutdown | integer | optional | Number of shutdown | -| result.runs | integer | mandatory | Number of runs | +| (property) | string | mandatory | A base64 encoded byte array string representing the EDID of the host | ### Example @@ -794,7 +1056,7 @@ Provides access to the socket information. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.socketinfo" + "method": "DeviceInfo.1.hostedid" } ``` @@ -804,39 +1066,22 @@ Provides access to the socket information. { "jsonrpc": "2.0", "id": 42, - "result": { - "total": 0, - "open": 0, - "link": 0, - "exception": 0, - "shutdown": 0, - "runs": 1 - } + "result": "AP///////wAQrMLQVEJTMQUdAQOANR546q11qVRNnSYPUFSlSwCBALMA0QBxT6lAgYDRwAEBVl4AoKCgKVAwIDUADighAAAaAAAA/wBNWTNORDkxVjFTQlQKAAAA/ABERUxMIFAyNDE4RAogAAAA/QAxVh1xHAAKICAgICAgARsCAxuxUJAFBAMCBxYBBhESFRMUHyBlAwwAEAACOoAYcTgtQFgsRQAOKCEAAB4BHYAYcRwWIFgsJQAOKCEAAJ6/FgCggDgTQDAgOgAOKCEAABp+OQCggDgfQDAgOgAOKCEAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2A" } ``` - -## *supportedaudioports [property](#head.Properties)* + +## *atmos [property](#head_Properties)* -Provides access to the audio ports supported on the device (all ports that are physically present). +Provides access to the atmos support by this device. > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Audio ports supported on the device (all ports that are physically present) | -| result.supportedAudioPorts | array | mandatory | Audio Output support | -| result.supportedAudioPorts[#] | string | mandatory | Audio output supported by the device (must be one of the following: *ANALOG, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SPDIF0*) | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | boolean | mandatory | True if device supports Atmos, false otherwise | ### Example @@ -846,7 +1091,7 @@ Provides access to the audio ports supported on the device (all ports that are p { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.supportedaudioports" + "method": "DeviceInfo.1.atmos" } ``` @@ -856,36 +1101,22 @@ Provides access to the audio ports supported on the device (all ports that are p { "jsonrpc": "2.0", "id": 42, - "result": { - "supportedAudioPorts": [ - "analog" - ] - } + "result": false } ``` - -## *supportedvideodisplays [property](#head.Properties)* + +## *cec [property](#head_Properties)* -Provides access to the video ports supported on the device (all ports that are physically present). +Provides access to the CEC support by this device. > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Video ports supported on the device (all ports that are physically present) | -| result.supportedVideoDisplays | array | mandatory | Video Output support | -| result.supportedVideoDisplays[#] | string | mandatory | Video output supported by the device (must be one of the following: *COMPONET, COMPOSITE, DISPLAYPORT, HDMI0, HDMI1, OTHER, RF_MODULATOR, SCART_RGB, SVIDEO*) | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | boolean | mandatory | True if device supports CEC, false otherwise | ### Example @@ -895,7 +1126,7 @@ Provides access to the video ports supported on the device (all ports that are p { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.supportedvideodisplays" + "method": "DeviceInfo.1.cec" } ``` @@ -905,35 +1136,22 @@ Provides access to the video ports supported on the device (all ports that are p { "jsonrpc": "2.0", "id": 42, - "result": { - "supportedVideoDisplays": [ - "displayport" - ] - } + "result": false } ``` - -## *hostedid [property](#head.Properties)* + +## *version [property](#head_Properties)* -Provides access to the EDID of the host. +Provides access to the software version (in form *version#hashtag*) param value: Software version of the device (e.g. 1.0#14452f612c3747645d54974255d11b8f3b4faa54). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | EDID of the host | -| result.EDID | string | mandatory | A base64 encoded byte array string representing the EDID | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | string | mandatory | Software version (in form *version#hashtag*) param value: Software version of the device (e.g. 1.0#14452f612c3747645d54974255d11b8f3b4faa54) | ### Example @@ -943,7 +1161,7 @@ Provides access to the EDID of the host. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.hostedid" + "method": "DeviceInfo.1.version" } ``` @@ -953,36 +1171,22 @@ Provides access to the EDID of the host. { "jsonrpc": "2.0", "id": 42, - "result": { - "EDID": "AP///////wAQrMLQVEJTMQUdAQOANR546q11qVRNnSYPUFSlSwCBALMA0QBxT6lAgYDRwAEBVl4AoKCgKVAwIDUADighAAAaAAAA/wBNWTNORDkxVjFTQlQKAAAA/ABERUxMIFAyNDE4RAogAAAA/QAxVh1xHAAKICAgICAgARsCAxuxUJAFBAMCBxYBBhESFRMUHyBlAwwAEAACOoAYcTgtQFgsRQAOKCEAAB4BHYAYcRwWIFgsJQAOKCEAAJ6/FgCggDgTQDAgOgAOKCEAABp+OQCggDgfQDAgOgAOKCEAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2A" - } + "result": "..." } ``` - -## *firmwareversion [property](#head.Properties)* + +## *uptime [property](#head_Properties)* -Provides access to the versions maintained in version.txt. +Provides access to the system uptime (in seconds) param value: System uptime in seconds (e.g. 120). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Versions maintained in version.txt | -| result.imagename | string | mandatory | Name of firmware image | -| result?.sdk | string | optional | SDK version string | -| result?.mediarite | string | optional | Mediarite value | -| result?.yocto | string | optional | Yocto version (must be one of the following: *daisy, dunfell, kirkstone, morty*) | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | integer | mandatory | System uptime (in seconds) param value: System uptime in seconds (e.g. 120) | ### Example @@ -992,7 +1196,7 @@ Provides access to the versions maintained in version.txt. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.firmwareversion" + "method": "DeviceInfo.1.uptime" } ``` @@ -1002,36 +1206,22 @@ Provides access to the versions maintained in version.txt. { "jsonrpc": "2.0", "id": 42, - "result": { - "imagename": "PX051AEI_VBN_2203_sprint_20220331225312sdy_NG", - "sdk": "17.3", - "mediarite": "8.3.53", - "yocto": "dunfell" - } + "result": 0 } ``` - -## *serialnumber [property](#head.Properties)* + +## *totalram [property](#head_Properties)* -Provides access to the serial number set by manufacturer. +Provides access to the total installed system RAM (in bytes) param value: Total installed system RAM in bytes (e.g. 655757312). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Serial number set by manufacturer | -| result.serialnumber | string | mandatory | Device Serial Number | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | integer | mandatory | Total installed system RAM (in bytes) param value: Total installed system RAM in bytes (e.g. 655757312) | ### Example @@ -1041,7 +1231,7 @@ Provides access to the serial number set by manufacturer. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.serialnumber" + "method": "DeviceInfo.1.totalram" } ``` @@ -1051,33 +1241,22 @@ Provides access to the serial number set by manufacturer. { "jsonrpc": "2.0", "id": 42, - "result": { - "serialnumber": "PAW400003744" - } + "result": 0 } ``` - -## *make [property](#head.Properties)* + +## *freeram [property](#head_Properties)* -Provides access to the device manufacturer. +Provides access to the free system RAM (in bytes) param value: System RAM still available in bytes (e.g. 563015680). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device manufacturer | -| result.make | string | mandatory | Device manufacturer (must be one of the following: *Amlogic_Inc, Pioneer, arris, cisco, commscope, element, hisense, llama, pace, platco, raspberrypi_org, samsung, sercomm, sky, technicolor*) | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | integer | mandatory | Free system RAM (in bytes) param value: System RAM still available in bytes (e.g. 563015680) | ### Example @@ -1087,7 +1266,7 @@ Provides access to the device manufacturer. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.make" + "method": "DeviceInfo.1.freeram" } ``` @@ -1097,33 +1276,22 @@ Provides access to the device manufacturer. { "jsonrpc": "2.0", "id": 42, - "result": { - "make": "pace" - } + "result": 0 } ``` - -## *modelid [property](#head.Properties)* + +## *totalswap [property](#head_Properties)* -Provides access to the device model number or SKU. +Provides access to the total swap space (in bytes) param value: Total swap space in bytes (e.g. 789132680). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device model number or SKU | -| result.sku | string | mandatory | Device model number or SKU (must be one of the following: *AX013AN, AX014AN, AX061AEI, CMXI11BEI, CS011AN, CXD01ANI, ELTE11MWR, HSTP11MWR, HSTP11MWRFX50, LS301, MX011AN, PI, PITU11MWR, PLTL11AEI, PX001AN, PX013AN, PX022AN, PX032ANI, PX051AEI, PXD01ANI, SCXI11AIC, SCXI11BEI, SKTL11AEI, SKXI11ADS, SKXI11AIS, SKXI11ANS, SX022AN, TX061AEI, XUSHTB11MWR, XUSHTC11MWR, XUSPTC11MWR, ZWCN11MWI*) | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | integer | mandatory | Total swap space (in bytes) param value: Total swap space in bytes (e.g. 789132680) | ### Example @@ -1133,7 +1301,7 @@ Provides access to the device model number or SKU. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.modelid" + "method": "DeviceInfo.1.totalswap" } ``` @@ -1143,33 +1311,22 @@ Provides access to the device model number or SKU. { "jsonrpc": "2.0", "id": 42, - "result": { - "sku": "PX051AEI" - } + "result": 0 } ``` - -## *modelname [property](#head.Properties)* + +## *freeswap [property](#head_Properties)* -Provides access to the device model name. +Provides access to the free swap space (in bytes) param value: Swap space still available in bytes (e.g. 789132680). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device model name | -| result.model | string | mandatory | Device model name | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | integer | mandatory | Free swap space (in bytes) param value: Swap space still available in bytes (e.g. 789132680) | ### Example @@ -1179,7 +1336,7 @@ Provides access to the device model name. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.modelname" + "method": "DeviceInfo.1.freeswap" } ``` @@ -1189,33 +1346,22 @@ Provides access to the device model name. { "jsonrpc": "2.0", "id": 42, - "result": { - "model": "Pace Xi5" - } + "result": 0 } ``` - -## *modelyear [property](#head.Properties)* + +## *devicename [property](#head_Properties)* -Provides access to the device model year. +Provides access to the host name param value: Host name of the device (e.g. buildroot). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device model year | -| result.year | integer | mandatory | Device model year | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | string | mandatory | Host name param value: Host name of the device (e.g. buildroot) | ### Example @@ -1225,7 +1371,7 @@ Provides access to the device model year. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.modelyear" + "method": "DeviceInfo.1.devicename" } ``` @@ -1235,33 +1381,22 @@ Provides access to the device model year. { "jsonrpc": "2.0", "id": 42, - "result": { - "year": 2020 - } + "result": "..." } ``` - -## *friendlyname [property](#head.Properties)* + +## *cpuload [property](#head_Properties)* -Provides access to the device friendly name. +Provides access to the current CPU load (percentage) param value: Current CPU load in percentage (e.g. 2). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device friendly name | -| result.name | string | mandatory | Device friendly name | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | integer | mandatory | Current CPU load (percentage) param value: Current CPU load in percentage (e.g. 2) | ### Example @@ -1271,7 +1406,7 @@ Provides access to the device friendly name. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.friendlyname" + "method": "DeviceInfo.1.cpuload" } ``` @@ -1281,33 +1416,25 @@ Provides access to the device friendly name. { "jsonrpc": "2.0", "id": 42, - "result": { - "name": "My device" - } + "result": 0 } ``` - -## *platformname [property](#head.Properties)* + +## *cpuloadavgs [property](#head_Properties)* -Provides access to the device Platform name. +Provides access to the CPU load averages from 1, 5 and 15 minutes (percentage) param value: An array of three CPU load averages in percentage (e.g. [2, 3, 4]). > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device Platform name | -| result.name | string | mandatory | Device Platform name | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | object | mandatory | CPU load averages from 1, 5 and 15 minutes (percentage) param value: An array of three CPU load averages in percentage (e.g. [2, 3, 4]) | +| (property).avg1min | integer | mandatory | Avarage CPU load over the last minute | +| (property).avg5min | integer | mandatory | Avarage CPU load over the last 5 minutes | +| (property).avg15min | integer | mandatory | Avarage CPU load over the last 15 minutes | ### Example @@ -1317,7 +1444,7 @@ Provides access to the device Platform name. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.platformname" + "method": "DeviceInfo.1.cpuloadavgs" } ``` @@ -1328,32 +1455,30 @@ Provides access to the device Platform name. "jsonrpc": "2.0", "id": 42, "result": { - "name": "Linux" + "avg1min": 10, + "avg5min": 15, + "avg15min": 20 } } ``` - -## *devicetype [property](#head.Properties)* + +## *addresses [property](#head_Properties)* -Provides access to the device type. +Provides access to the network interface addresses. > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Device type | -| result.devicetype | string | mandatory | Device type (must be one of the following: *IpStb, QamIpStb, hybrid, mediaclient, tv*) | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | array | mandatory | An array of network interfaces with their addresses | +| (property)[#] | object | mandatory | *...* | +| (property)[#].name | string | mandatory | Name of the network interface | +| (property)[#].mac | string | mandatory | MAC address of the network interface | +| (property)[#]?.ipaddresses | array | optional | List of IP addresses assigned to the network interface
*Array length must be at most 100 elements.* | +| (property)[#]?.ipaddresses[#] | string | mandatory | *...* | ### Example @@ -1363,7 +1488,7 @@ Provides access to the device type. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.devicetype" + "method": "DeviceInfo.1.addresses" } ``` @@ -1373,33 +1498,36 @@ Provides access to the device type. { "jsonrpc": "2.0", "id": 42, - "result": { - "devicetype": "IpStb" - } + "result": [ + { + "name": "lo", + "mac": "00:00:00:00:00:00", + "ipaddresses": [ + "..." + ] + } + ] } ``` - -## *distributorid [property](#head.Properties)* + +## *socketinfo [property](#head_Properties)* -Provides access to the partner ID or distributor ID for device. +Provides access to the socket information. > This property is **read-only**. ### Value -### Result - | Name | Type | M/O | Description | | :-------- | :-------- | :-------- | :-------- | -| result | object | mandatory | Partner ID or distributor ID for device | -| result.distributorid | string | mandatory | Partner ID or distributor ID for device (must be one of the following: *MIT, charter, charter-dev, comcast, cox, cox-dev, cox-hospitality, cox-qa, rogers, rogers-dev, shaw, shaw-dev, sky-de, sky-deu, sky-deu-dev, sky-it, sky-it-dev, sky-italia, sky-uk, sky-uk-dev, videotron, xglobal*) | - -### Errors - -| Message | Description | -| :-------- | :-------- | -| ```ERROR_GENERAL``` | General error | +| (property) | object | mandatory | Information about the sockets | +| (property)?.total | integer | optional | Total number of sockets | +| (property)?.open | integer | optional | Number of open sockets | +| (property)?.link | integer | optional | Number of linked sockets | +| (property)?.exception | integer | optional | Number of exceptions | +| (property)?.shutdown | integer | optional | Number of sockets that were shut down | +| (property).runs | integer | mandatory | Number of resource monitor runs | ### Example @@ -1409,7 +1537,7 @@ Provides access to the partner ID or distributor ID for device. { "jsonrpc": "2.0", "id": 42, - "method": "DeviceInfo.1.distributorid" + "method": "DeviceInfo.1.socketinfo" } ``` @@ -1420,7 +1548,12 @@ Provides access to the partner ID or distributor ID for device. "jsonrpc": "2.0", "id": 42, "result": { - "distributorid": "comcast" + "total": 1024, + "open": 512, + "link": 256, + "exception": 128, + "shutdown": 64, + "runs": 32 } } ``` From 122ac27ac763201562424fa90c389716171d71b9 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 14 Apr 2025 12:55:07 +0200 Subject: [PATCH 9/9] Remove the unnecessary files from the Windows project file --- DeviceInfo/DeviceInfo.vcxproj | 1 - DeviceInfo/DeviceInfo.vcxproj.filters | 3 --- 2 files changed, 4 deletions(-) diff --git a/DeviceInfo/DeviceInfo.vcxproj b/DeviceInfo/DeviceInfo.vcxproj index 6336a7f4..26ff06ea 100644 --- a/DeviceInfo/DeviceInfo.vcxproj +++ b/DeviceInfo/DeviceInfo.vcxproj @@ -177,7 +177,6 @@ - diff --git a/DeviceInfo/DeviceInfo.vcxproj.filters b/DeviceInfo/DeviceInfo.vcxproj.filters index 8d50b06b..bd9a1d39 100644 --- a/DeviceInfo/DeviceInfo.vcxproj.filters +++ b/DeviceInfo/DeviceInfo.vcxproj.filters @@ -26,9 +26,6 @@ Source Files - - Source Files - Source Files