cec: sync C and .NET interfaces with C++
[deb_libcec.git] / src / LibCecSharp / LibCecSharp.cpp
index caf60542859622a1576a42c342dc85f9eed197b4..0737dbbb77f9adb29eff746fdcdef68efd434e87 100644 (file)
@@ -117,6 +117,7 @@ namespace CecSharp
                        }
                        config.bPowerOffScreensaver = netConfig->PowerOffScreensaver ? 1 : 0;
                        config.bPowerOffOnStandby   = netConfig->PowerOffOnStandby ? 1 : 0;
+      config.bSendInactiveSource  = netConfig->SendInactiveSource ? 1 : 0;
                        config.callbacks            = &g_cecCallbacks;
                }
 
@@ -480,6 +481,31 @@ namespace CecSharp
                        return bReturn;
                }
 
+    bool IsLibCECActiveSource()
+    {
+      return m_libCec->IsLibCECActiveSource();
+    }
+
+    bool GetDeviceInformation(String ^ port, LibCECConfiguration ^configuration, uint32_t timeoutMs)
+    {
+      bool bReturn(false);
+      marshal_context ^ context = gcnew marshal_context();
+
+      libcec_configuration config;
+                       config.Clear();
+
+      const char* strPortC = port->Length > 0 ? context->marshal_as<const char*>(port) : NULL;
+
+      if (m_libCec->GetDeviceInformation(strPortC, &config, timeoutMs))
+                       {
+                               configuration->Update(config);
+        bReturn = true;
+                       }
+
+      delete context;
+      return bReturn;
+    }
+
                String ^ ToString(CecLogicalAddress iAddress)
                {
                        const char *retVal = m_libCec->ToString((cec_logical_address)iAddress);