• 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 38
Automatic WakeOnLan upon accessing MySql or FileShares
I'm gonna try again with a new git folder I have probably done something do mess it up, I have never had to apply patch before. It is just "git apply thepatch.patch" isn't it?
Reply
t4_ravenbird Wrote:in wakeonaccess.h try

#include <vector>
#include "utils/StdString.h"
before the other includes ..
Reply
You will also need to add the new file "wakeonaccess.cpp" to the build system of the target you want to build for.. And there may be other warnings or errors that pops up since I have no chance of testing other compilers than ms. Let me know if you have other error, maybe I can help with tip
Reply
so

Code:
*  http://www.gnu.org/copyleft/gpl.html
*
*/

#include <vector>
#include "utils/StdString.h"
#include "threads/SystemClock.h"
#include "utils/Job.h"

class CURL;
class CMediaSource;

typedef std::vector<CMediaSource> VECSOURCES;

class CWakeOnAccess : public IJobCallback
{
public:
  CWakeOnAccess();
  static CWakeOnAccess &Get();

  void WakeUpHost (const CURL& fileUrl);

and copy wakeonaccess.cpp From xbmc/network to xbmc/network/linux ?
Reply
To build on windows using VS2010, the project file had to be updated to build the new files. You need to do this for whatever the build system is in Linux.

project/VS2010Express/XBMC.vcxproj | 2 +
project/VS2010Express/XBMC.vcxproj.filters | 6 +

Open the patch file in a text viewer and you can see the lines added to those 2 files so that they also get built. You need to do the same for whatever is used in Linux.

Code:
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj
index 4c7824d..27eadb1 100644
--- a/project/VS2010Express/XBMC.vcxproj
+++ b/project/VS2010Express/XBMC.vcxproj
@@ -839,6 +839,7 @@
     <ClCompile Include="..\..\xbmc\network\upnp\UPnPInternal.cpp" />
     <ClCompile Include="..\..\xbmc\network\upnp\UPnPRenderer.cpp" />
     <ClCompile Include="..\..\xbmc\network\upnp\UPnPServer.cpp" />
+    <ClCompile Include="..\..\xbmc\network\WakeOnAccess.cpp" />
     <ClCompile Include="..\..\xbmc\network\WebServer.cpp" />
     <ClCompile Include="..\..\xbmc\network\websocket\WebSocket.cpp" />
     <ClCompile Include="..\..\xbmc\network\websocket\WebSocketManager.cpp" />
@@ -1082,6 +1083,7 @@
     <ClInclude Include="..\..\xbmc\network\upnp\UPnPInternal.h" />
     <ClInclude Include="..\..\xbmc\network\upnp\UPnPRenderer.h" />
     <ClInclude Include="..\..\xbmc\network\upnp\UPnPServer.h" />
+    <ClInclude Include="..\..\xbmc\network\WakeOnAccess.h" />
     <ClInclude Include="..\..\xbmc\network\websocket\WebSocket.h" />
     <ClInclude Include="..\..\xbmc\network\websocket\WebSocketManager.h" />
     <ClInclude Include="..\..\xbmc\network\websocket\WebSocketV13.h" />

diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters
index b471ebf..a6eb4d9 100644
--- a/project/VS2010Express/XBMC.vcxproj.filters
+++ b/project/VS2010Express/XBMC.vcxproj.filters
@@ -2918,6 +2918,9 @@
     <ClCompile Include="..\..\xbmc\music\tags\MusicInfoTagLoaderWav.cpp">
       <Filter>music\tags</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\xbmc\network\WakeOnAccess.cpp">
+      <Filter>network</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\xbmc\interfaces\python\test\TestSwig.cpp">
       <Filter>interfaces\python\test</Filter>
     </ClCompile>
@@ -5716,6 +5719,9 @@
     <ClInclude Include="..\..\xbmc\interfaces\python\XBPyThread.h">
       <Filter>interfaces\python</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\xbmc\network\WakeOnAccess.h">
+      <Filter>network</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\xbmc\music\tags\TagLibVFSStream.h">
       <Filter>music\tags</Filter>
     </ClInclude>
Reply
Well I have done as my previous post and the make has got a lot further and is still going so fingers crossed.

I have hopefully not just jinxed myself.
Reply
(2012-10-19, 22:38)bilbonvidia Wrote: so

Code:
#include <vector>
#include "utils/StdString.h"
#include "threads/SystemClock.h"
#include "utils/Job.h"
...

and copy wakeonaccess.cpp From xbmc/network to xbmc/network/linux ?


File is OK (did it help for your previous errors?)

*
Not move or copy wakeonacccess.cpp .. add it to the build by editing buildfiles
For linux, I think you need to edit "xbmc\network\makefile.in" - add the file alongside the files allready listed..
Reply
Yes it definitely helped got a lot futher but did fail

Code:
CPP     xbmc/cores/paplayer/SPCCodec.o
AR      xbmc/cores/paplayer/paplayer.a
LD      xbmc.bin
xbmc/settings/settings.a(GUIWindowSettingsCategory.o): In function `CGUIWindowSettingsCategory::OnSettingChanged(CBaseSet                             tingControl*)':
/home/billy/attempt2/xbmc/settings/GUIWindowSettingsCategory.cpp:1998: undefined reference to `CWakeOnAccess::Get()'
/home/billy/attempt2/xbmc/settings/GUIWindowSettingsCategory.cpp:2000: undefined reference to `CWakeOnAccess::QueueMACDis                             coveryForAllRemotes()'
xbmc/settings/settings.a(Settings.o): In function `CSettings::UpdateShare(CStdStr<char> const&, CStdStr<char>, CMediaSour                             ce const&)':
/home/billy/attempt2/xbmc/settings/Settings.cpp:1231: undefined reference to `CWakeOnAccess::Get()'
/home/billy/attempt2/xbmc/settings/Settings.cpp:1231: undefined reference to `CWakeOnAccess::QueueMACDiscoveryForShare(CM                             ediaSource const&)'
xbmc/settings/settings.a(Settings.o): In function `CSettings::AddShare(CStdStr<char> const&, CMediaSource const&)':
/home/billy/attempt2/xbmc/settings/Settings.cpp:1324: undefined reference to `CWakeOnAccess::Get()'
/home/billy/attempt2/xbmc/settings/Settings.cpp:1324: undefined reference to `CWakeOnAccess::QueueMACDiscoveryForShare(CM                             ediaSource const&)'
xbmc/settings/settings.a(Settings.o): In function `CSettings::Load()':
/home/billy/attempt2/xbmc/settings/Settings.cpp:183: undefined reference to `CWakeOnAccess::Get()'
/home/billy/attempt2/xbmc/settings/Settings.cpp:183: undefined reference to `CWakeOnAccess::LoadFromXML()'
xbmc/dbwrappers/dbwrappers.a(mysqldataset.o): In function `dbiplus::MysqlDatabase::connect(bool)':
/home/billy/attempt2/xbmc/dbwrappers/mysqldataset.cpp:123: undefined reference to `CWakeOnAccess::Get()'
/home/billy/attempt2/xbmc/dbwrappers/mysqldataset.cpp:123: undefined reference to `CWakeOnAccess::WakeUpHost(CStdStr<char                             > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
xbmc/filesystem/filesystem.a(DirectoryFactory.o): In function `XFILE::CDirectoryFactory::Create(CStdStr<char> const&)':
/home/billy/attempt2/xbmc/filesystem/DirectoryFactory.cpp:127: undefined reference to `CWakeOnAccess::Get()'
/home/billy/attempt2/xbmc/filesystem/DirectoryFactory.cpp:127: undefined reference to `CWakeOnAccess::WakeUpHost(CURL con                             st&)'
xbmc/filesystem/filesystem.a(FileFactory.o): In function `XFILE::CFileFactory::CreateLoader(CURL const&)':
/home/billy/attempt2/xbmc/filesystem/FileFactory.cpp:116: undefined reference to `CWakeOnAccess::Get()'
/home/billy/attempt2/xbmc/filesystem/FileFactory.cpp:116: undefined reference to `CWakeOnAccess::WakeUpHost(CURL const&)'
collect2: ld returned 1 exit status
make: *** [xbmc.bin] Error 1
billy@htpc:~/attempt2$ sudo make install
[sudo] password for billy:
Copying XBMC binary to /usr/local/lib/xbmc/
install: cannot stat `xbmc.bin': No such file or directory
make: *** [install-binaries] Error 1

I'll try you next suggestion, well your first one but correctly.
so makefile.in

Code:
SRCS  = cddb.cpp
SRCS += DNSNameCache.cpp
SRCS += EventClient.cpp
SRCS += EventPacket.cpp
SRCS += EventServer.cpp
SRCS += GUIDialogAccessPoints.cpp
SRCS += GUIDialogNetworkSetup.cpp
SRCS += Network.cpp
SRCS += Socket.cpp
SRCS += TCPServer.cpp
SRCS += UdpClient.cpp
SRCS += WebServer.cpp
SRCS += ZeroconfBrowser.cpp
SRCS += Zeroconf.cpp
SRCS += WakeOnAccess.cpp

ifeq (@USE_AIRPLAY@, 1)
SRCS += AirPlayServer.cpp
endif

ifeq (@USE_AIRTUNES@, 1)
SRCS += AirTunesServer.cpp
endif

LIB = network.a

include @abs_top_srcdir@/Makefile.include
-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))

Lets try
Reply
Does linux not need to compile the WakeOnAccess.h file?
Reply
Code:
CPP     xbmc/network/Zeroconf.o
AR      xbmc/video/windows/videowindows.a
CPP     xbmc/utils/AlarmClock.o
CPP     xbmc/network/WakeOnAccess.o
WakeOnAccess.cpp: In function âlong unsigned int HostToIP(const CStdString&)â:
WakeOnAccess.cpp:51:30: error: âinet_addrâ was not declared in this scope
WakeOnAccess.cpp: In constructor âCWakeOnAccess::WakeUpEntry::WakeUpEntry()â:
WakeOnAccess.cpp:55:16: error: âINT_MAXâ was not declared in this scope
WakeOnAccess.cpp: In member function âvirtual bool CWakeOnAccess::CMACDiscoveryJob::DoWork()â:
WakeOnAccess.cpp:70:20: error: âINADDR_NONEâ was not declared in this scope
WakeOnAccess.cpp: In member function âvoid CWakeOnAccess::AddHostsFromShare(const CMediaSource&, std::vector<std::basic_string<char> >&)â:
WakeOnAccess.cpp:364:51: error: invalid use of incomplete type âconst struct CMediaSourceâ
WakeOnAccess.h:28:7: error: forward declaration of âconst struct CMediaSourceâ
WakeOnAccess.cpp:364:83: error: invalid use of incomplete type âconst struct CMediaSourceâ
WakeOnAccess.h:28:7: error: forward declaration of âconst struct CMediaSourceâ
In file included from /usr/include/c++/4.6/bits/stl_algobase.h:68:0,
                 from /usr/include/c++/4.6/vector:61,
                 from WakeOnAccess.h:22,
                 from WakeOnAccess.cpp:22:
/usr/include/c++/4.6/bits/stl_iterator.h: In member function â__gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator++(int) [with _Iterator = const CMediaSource*, _Container = std::vector<CMediaSource>, __gnu_cxx::__normal_iterator<_Iterator, _Container> = __gnu_cxx::__normal_iterator<const CMediaSource*, std::vector<CMediaSource> >]â:
WakeOnAccess.cpp:374:80:   instantiated from here
/usr/include/c++/4.6/bits/stl_iterator.h:748:46: error: cannot increment a pointer to incomplete type âconst CMediaSourceâ
WakeOnAccess.cpp: In function âlong unsigned int HostToIP(const CStdString&)â:
WakeOnAccess.cpp:52:1: warning: control reaches end of non-void function [-Wreturn-type]
/home/billy/attempt2/xbmc/utils/CharsetConverter.h: At global scope:
/home/billy/attempt2/xbmc/utils/CharsetConverter.h:83:1: warning: âg_charsetConverterâ defined but not used [-Wunused-variable]
/home/billy/attempt2/xbmc/guilib/GraphicContext.h:244:1: warning: âg_graphicsContextâ defined but not used [-Wunused-variable]
make[1]: *** [WakeOnAccess.o] Error 1
make: *** [xbmc/network/network.a] Error 2
make: *** Waiting for unfinished jobs....
CPP     xbmc/utils/AliasShortcutUtils.o
CPP     xbmc/utils/Archive.o
CPP     xbmc/utils/AsyncFileCopy.o
CPP     xbmc/utils/AutoPtrHandle.o
CPP     xbmc/utils/Base64.o
CPP     xbmc/utils/BitstreamConverter.o
CPP     xbmc/utils/BitstreamStats.o
CPP     xbmc/utils/CharsetConverter.o
CPP     xbmc/utils/CPUInfo.o
CPP     xbmc/utils/Crc32.o
CPP     xbmc/utils/CryptThreading.o
CPP     xbmc/utils/DatabaseUtils.o
CPP     xbmc/utils/DownloadQueue.o
CPP     xbmc/utils/DownloadQueueManager.o
CPP     xbmc/utils/EndianSwap.o
CPP     xbmc/utils/EdenVideoArtUpdater.o
CPP     xbmc/utils/Fanart.o
CPP     xbmc/utils/FileOperationJob.o
CPP     xbmc/utils/FileUtils.o
CPP     xbmc/utils/fft.o
CPP     xbmc/utils/GLUtils.o
CPP     xbmc/utils/HTMLTable.o
CPP     xbmc/utils/HTMLUtil.o
CPP     xbmc/utils/HttpHeader.o
CPP     xbmc/utils/HttpParser.o
CPP     xbmc/utils/HttpResponse.o
CPP     xbmc/utils/InfoLoader.o
CPP     xbmc/utils/JobManager.o
CPP     xbmc/utils/JSONVariantParser.o
CPP     xbmc/utils/JSONVariantWriter.o
CPP     xbmc/utils/LabelFormatter.o
CPP     xbmc/utils/LangCodeExpander.o
CPP     xbmc/utils/LCD.o
CPP     xbmc/utils/LCDFactory.o
CPP     xbmc/utils/log.o
CPP     xbmc/utils/md5.o
CPP     xbmc/utils/Observer.o
CPP     xbmc/utils/Mime.o
CPP     xbmc/utils/PerformanceSample.o
CPP     xbmc/utils/PerformanceStats.o
CPP     xbmc/utils/POUtils.o
CPP     xbmc/utils/RecentlyAddedJob.o
CPP     xbmc/utils/RegExp.o
CPP     xbmc/utils/RingBuffer.o
CPP     xbmc/utils/RssReader.o
CPP     xbmc/utils/ScraperParser.o
CPP     xbmc/utils/ScraperUrl.o
CPP     xbmc/utils/Screenshot.o
CPP     xbmc/utils/SeekHandler.o
CPP     xbmc/utils/SortUtils.o
CPP     xbmc/utils/Splash.o
CPP     xbmc/utils/Stopwatch.o
CPP     xbmc/utils/StreamDetails.o
CPP     xbmc/utils/StreamUtils.o
CPP     xbmc/utils/StringUtils.o
CPP     xbmc/utils/SystemInfo.o
CPP     xbmc/utils/TextSearch.o
CPP     xbmc/utils/TimeSmoother.o
CPP     xbmc/utils/TimeUtils.o
CPP     xbmc/utils/TuxBoxUtil.o
Mime.cpp: In function âstd::map<std::basic_string<char>, std::basic_string<char> > fillMimeTypes()â:
Mime.cpp:32:21: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
CPP     xbmc/utils/URIUtils.o
CPP     xbmc/utils/UrlOptions.o
CPP     xbmc/utils/Variant.o
CPP     xbmc/utils/Vector.o
CPP     xbmc/utils/Weather.o
CPP     xbmc/utils/XBMCTinyXML.o
CPP     xbmc/utils/XMLUtils.o
CC      xbmc/utils/fastmemcpy.o
CC      xbmc/utils/fstrcmp.o
CC      xbmc/utils/fastmemcpy-arm.o
AR      xbmc/utils/utils.a
billy@htpc:~/attempt2$ #sudo make install
billy@htpc:~/attempt2$
billy@htpc:~/attempt2$
Reply
(2012-10-19, 22:50)kricker Wrote: To build on windows using VS2010, the project file had to be updated to build the new files. You need to do this for whatever the build system is in Linux.

I have no clue, all of this is pretty new to me,
Reply
It took me a bit to figure out some of this stuff as well. I've never built on Linux either.
Reply
(2012-10-19, 23:29)bilbonvidia Wrote:
Code:
...
WakeOnAccess.cpp: In function âlong unsigned int HostToIP(const CStdString&)â:
WakeOnAccess.cpp:51:30: error: âinet_addrâ was not declared in this scope
...

Good, one step further, now WakeOnAccess.cpp is compiling (but there are errors due to differences in #inlcude files on win/linux)
In wakeOnAccess.cpp, try to replace all #includes with these ;
Code:
#include "system.h"
#include "network/network.h"
#include "MediaSource.h"
#include "Application.h"
#include "DNSNameCache.h"
#include "URL.h"
#include "dialogs/GUIDialogProgress.h"
#include "dialogs/GUIDialogKaiToast.h"
#include "filesystem/SpecialProtocol.h"
#include "guilib/GUIWindowManager.h"
#include "guilib/LocalizeStrings.h"
#include "settings/AdvancedSettings.h"
#include "settings/GUISettings.h"
#include "settings/Settings.h"
#include "utils/JobManager.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
#include "utils/XMLUtils.h"

#include "WakeOnAccess.h"

I am keeping these changes myself, so when we update the Pull Request it will be included
Reply
I had to change the case of the n in "network/Network.h" with Linux being case sensitive it couldnt find that file at first.

Code:
*  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*  http://www.gnu.org/copyleft/gpl.html
*
*/

#include "system.h"
#include "network/Network.h"
#include "MediaSource.h"
#include "Application.h"
#include "DNSNameCache.h"
#include "URL.h"
#include "dialogs/GUIDialogProgress.h"
#include "dialogs/GUIDialogKaiToast.h"
#include "filesystem/SpecialProtocol.h"
#include "guilib/GUIWindowManager.h"
#include "guilib/LocalizeStrings.h"
#include "settings/AdvancedSettings.h"
#include "settings/GUISettings.h"
#include "settings/Settings.h"
#include "utils/JobManager.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
#include "utils/XMLUtils.h"
#include "WakeOnAccess.h"

using namespace std;

Code:
CPP     xbmc/network/Zeroconf.o
CPP     xbmc/network/WakeOnAccess.o
WakeOnAccess.cpp: In function âlong unsigned int HostToIP(const CStdString&)â:
WakeOnAccess.cpp:53:30: error: âinet_addrâ was not declared in this scope
WakeOnAccess.cpp: In constructor âCWakeOnAccess::WakeUpEntry::WakeUpEntry()â:
WakeOnAccess.cpp:57:16: error: âINT_MAXâ was not declared in this scope
WakeOnAccess.cpp: In member function âvirtual bool CWakeOnAccess::CMACDiscoveryJ                         ob::DoWork()â:
WakeOnAccess.cpp:72:20: error: âINADDR_NONEâ was not declared in this scope
WakeOnAccess.cpp: In function âlong unsigned int HostToIP(const CStdString&)â:
WakeOnAccess.cpp:54:1: warning: control reaches end of non-void function [-Wretu                         rn-type]
/home/billy/attempt2/xbmc/utils/CharsetConverter.h: At global scope:
/home/billy/attempt2/xbmc/utils/CharsetConverter.h:83:1: warning: âg_charsetConv                         erterâ defined but not used [-Wunused-variable]
/home/billy/attempt2/xbmc/guilib/GraphicContext.h:244:1: warning: âg_graphicsCon                         textâ defined but not used [-Wunused-variable]
make[1]: *** [WakeOnAccess.o] Error 1
make: *** [xbmc/network/network.a] Error 2
billy@htpc:~/attempt2$
Reply
OK, try adding these 2 as the first #inlcudes;
#include <limits.h>
#include <sys/socket.h>

On second thought, add all of these..
#include <limits.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>

I dont know where things are defined but it should be covered now .. hopefully;-)
Reply
  • 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 38

Logout Mark Read Team Forum Stats Members Help
Automatic WakeOnLan upon accessing MySql or FileShares4