X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecSharp%2FLibCecSharp.cpp;h=7f0667a84066d92245f91ba1827c7aa263aabcdc;hb=c2ce7bd11448e5e84ccce0ff5e466ca82e713190;hp=680ccfba6f2ffa51b549e145c202c1c78cb3a97f;hpb=92da1117ccc9567075c90df5b701f40863392874;p=deb_libcec.git diff --git a/src/LibCecSharp/LibCecSharp.cpp b/src/LibCecSharp/LibCecSharp.cpp index 680ccfb..7f0667a 100644 --- a/src/LibCecSharp/LibCecSharp.cpp +++ b/src/LibCecSharp/LibCecSharp.cpp @@ -91,7 +91,8 @@ namespace CecSharp { config.Clear(); - _snprintf_s(config.strDeviceName, 13, context->marshal_as(netConfig->DeviceName)); + const char *strDeviceName = context->marshal_as(netConfig->DeviceName); + memcpy_s(config.strDeviceName, 13, strDeviceName, 13); for (unsigned int iPtr = 0; iPtr < 5; iPtr++) config.deviceTypes.types[iPtr] = (cec_device_type)netConfig->DeviceTypes->Types[iPtr]; @@ -128,7 +129,15 @@ namespace CecSharp } if (netConfig->ServerVersion >= CecServerVersion::Version1_6_2) - _snprintf_s(config.strDeviceLanguage, 3, context->marshal_as(netConfig->DeviceLanguage)); + { + const char *strDeviceLanguage = context->marshal_as(netConfig->DeviceLanguage); + memcpy_s(config.strDeviceLanguage, 3, strDeviceLanguage, 3); + } + + if (netConfig->ServerVersion >= CecServerVersion::Version1_6_3) + { + config.bMonitorOnly = netConfig->MonitorOnlyClient ? 1 : 0; + } config.callbacks = &g_cecCallbacks; } @@ -226,7 +235,7 @@ namespace CecSharp cec_keypress key; if (m_libCec->GetNextKeypress(&key)) { - return gcnew CecKeypress(key.keycode, key.duration); + return gcnew CecKeypress((CecUserControlCode)key.keycode, key.duration); } return gcnew CecKeypress();