diff options
author | Christian Fetzer <fetzer.ch@googlemail.com> | 2013-01-15 21:51:33 +0100 |
---|---|---|
committer | Christian Fetzer <fetzer.ch@googlemail.com> | 2013-02-16 17:18:08 +0100 |
commit | 1d0d85be4e2fdec0613a4ab486cff4332f6ddcb3 (patch) | |
tree | 61de6b7448244d6519379c07bcca99305d8fbd51 /addons/library.xbmc.addon | |
parent | 4659e134824d3cd8b18e2bad6409fb4f0a901179 (diff) |
addons: Add WakeOnLan function
WakeOnLan allows addons to send a wol magic packet.
This can be used for example in pvr addons to wake up a pvr backend.
Diffstat (limited to 'addons/library.xbmc.addon')
-rw-r--r-- | addons/library.xbmc.addon/libXBMC_addon.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/library.xbmc.addon/libXBMC_addon.h b/addons/library.xbmc.addon/libXBMC_addon.h index 35e58fa0e4..4740bd65d3 100644 --- a/addons/library.xbmc.addon/libXBMC_addon.h +++ b/addons/library.xbmc.addon/libXBMC_addon.h @@ -158,6 +158,10 @@ namespace ADDON dlsym(m_libXBMC_addon, "XBMC_queue_notification"); if (XBMC_queue_notification == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + XBMC_wake_on_lan = (bool (*)(void* HANDLE, void *CB, const char *mac)) + dlsym(m_libXBMC_addon, "XBMC_wake_on_lan"); + if (XBMC_wake_on_lan == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + XBMC_unknown_to_utf8 = (char* (*)(void* HANDLE, void* CB, const char* str)) dlsym(m_libXBMC_addon, "XBMC_unknown_to_utf8"); if (XBMC_unknown_to_utf8 == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } @@ -296,6 +300,16 @@ namespace ADDON } /*! + * @brief Send WakeOnLan magic packet. + * @param mac Network address of the host to wake. + * @return True if the magic packet was successfully sent, false otherwise. + */ + bool WakeOnLan(const char* mac) + { + return XBMC_wake_on_lan(m_Handle, m_Callbacks, mac); + } + + /*! * @brief Translate a string with an unknown encoding to UTF8. * @param str The string to translate. * @return The string translated to UTF8. Must be freed by calling FreeString() when done. @@ -541,6 +555,7 @@ namespace ADDON void (*XBMC_log)(void *HANDLE, void* CB, const addon_log_t loglevel, const char *msg); bool (*XBMC_get_setting)(void *HANDLE, void* CB, const char* settingName, void *settingValue); void (*XBMC_queue_notification)(void *HANDLE, void* CB, const queue_msg_t type, const char *msg); + bool (*XBMC_wake_on_lan)(void *HANDLE, void* CB, const char* mac); char* (*XBMC_unknown_to_utf8)(void *HANDLE, void* CB, const char* str); char* (*XBMC_get_localized_string)(void *HANDLE, void* CB, int dwCode); char* (*XBMC_get_dvd_menu_language)(void *HANDLE, void* CB); |