From: Lars Op den Kamp Date: Mon, 1 Oct 2012 11:44:11 +0000 (+0200) Subject: added FirmwareBuildDate, CECVersion and AdapterType to LibCecSharp's configuration too X-Git-Tag: upstream/2.2.0~1^2~17^2^2~56 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=22190f063f6db2ae411e59b208bce90c2d607123 added FirmwareBuildDate, CECVersion and AdapterType to LibCecSharp's configuration too --- diff --git a/src/LibCecSharp/CecSharpTypes.h b/src/LibCecSharp/CecSharpTypes.h index 368c52e..433685a 100644 --- a/src/LibCecSharp/CecSharpTypes.h +++ b/src/LibCecSharp/CecSharpTypes.h @@ -396,6 +396,14 @@ namespace CecSharp Version1_9_0 = 0x1900 }; + public enum class CecAdapterType + { + Unknown = 0, + PulseEightExternal = 0x1, + PulseEightDaughterboard = 0x2, + RaspberryPi = 0x100 + }; + /// /// Descriptor of a CEC adapter, /// @@ -782,6 +790,9 @@ namespace CecSharp PowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY == 1; ShutdownOnStandby = CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY == 1; DeviceLanguage = ""; + FirmwareBuildDate = gcnew System::DateTime(1970,1,1,0,0,0,0); + CECVersion = (CecVersion)CEC_DEFAULT_SETTING_CEC_VERSION; + AdapterType = CecAdapterType::Unknown; } /// @@ -849,10 +860,20 @@ namespace CecSharp } if (ServerVersion >= CecServerVersion::Version1_6_2) + { DeviceLanguage = gcnew System::String(config.strDeviceLanguage); + FirmwareBuildDate = gcnew System::DateTime(1970,1,1,0,0,0,0); + FirmwareBuildDate = FirmwareBuildDate->AddSeconds(config.iFirmwareBuildDate); + } if (ServerVersion >= CecServerVersion::Version1_6_3) MonitorOnlyClient = config.bMonitorOnly == 1; + + if (ServerVersion >= CecServerVersion::Version1_8_0) + CECVersion = (CecVersion)config.cecVersion; + + if (ServerVersion >= CecServerVersion::Version1_8_2) + AdapterType = (CecAdapterType)config.adapterType; } /// @@ -970,6 +991,21 @@ namespace CecSharp /// The callback methods to use. /// property CecCallbackMethods ^ Callbacks; + + /// + /// The build date of the firmware. + /// + property System::DateTime ^ FirmwareBuildDate; + + /// + /// The CEC version that libCEC uses. + /// + property CecVersion CECVersion; + + /// + /// The type of adapter that libCEC is connected to. + /// + property CecAdapterType AdapterType; }; // the callback methods are called by unmanaged code, so we need some delegates for this diff --git a/src/LibCecSharp/LibCecSharp.cpp b/src/LibCecSharp/LibCecSharp.cpp index 073ae77..a008f2e 100644 --- a/src/LibCecSharp/LibCecSharp.cpp +++ b/src/LibCecSharp/LibCecSharp.cpp @@ -801,6 +801,9 @@ namespace CecSharp if (netConfig->ServerVersion >= CecServerVersion::Version1_6_3) config.bMonitorOnly = netConfig->MonitorOnlyClient ? 1 : 0; + if (netConfig->ServerVersion >= CecServerVersion::Version1_8_0) + config.cecVersion = (cec_version)netConfig->CECVersion; + config.callbacks = &g_cecCallbacks; }