+/*!
+ * @brief Start the bootloader on the first device that was detected.
+ * @param strLib The name of and/or path to libCEC
+ * @return True when the command was sent, false otherwise.
+ */
+bool LibCecBootloader(const char *strLib = NULL)
+{
+ if (!g_libCEC)
+ {
+#if defined(__APPLE__)
+ g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY);
+#else
+ g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY);
+#endif
+ if (!g_libCEC)
+ {
+ cout << dlerror() << endl;
+ return NULL;
+ }
+ }
+
+ typedef bool _LibCecBootloader(void);
+ _LibCecBootloader* LibCecBootloader = (_LibCecBootloader*) dlsym(g_libCEC, "CECStartBootloader");
+ if (!LibCecBootloader)
+ {
+ cout << "cannot find CECStartBootloader" << endl;
+ return NULL;
+ }
+
+ bool bReturn = LibCecBootloader();
+ dlclose(g_libCEC);
+ return bReturn;
+}
+