diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..6d31dc4 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +/wiiscan/ diff --git a/bin/DelcomDLL.dll b/bin/DelcomDLL.dll deleted file mode 100644 index ecfa470..0000000 Binary files a/bin/DelcomDLL.dll and /dev/null differ diff --git a/bin/USBm.dll b/bin/USBm.dll deleted file mode 100644 index 1460ff3..0000000 Binary files a/bin/USBm.dll and /dev/null differ diff --git a/bin/WiimoteLib.dll b/bin/WiimoteLib.dll deleted file mode 100644 index 4408358..0000000 Binary files a/bin/WiimoteLib.dll and /dev/null differ diff --git a/bin/WiimoteWhiteboard.exe b/bin/WiimoteWhiteboard.exe deleted file mode 100644 index 1ca21b8..0000000 Binary files a/bin/WiimoteWhiteboard.exe and /dev/null differ diff --git a/bin/WiimoteWhiteboard_v0.3.exe b/bin/WiimoteWhiteboard_v0.3.exe deleted file mode 100644 index 9edbc31..0000000 Binary files a/bin/WiimoteWhiteboard_v0.3.exe and /dev/null differ diff --git a/bin/wiimotelibpoll.exe b/bin/wiimotelibpoll.exe deleted file mode 100644 index 7e13580..0000000 Binary files a/bin/wiimotelibpoll.exe and /dev/null differ diff --git a/bin/wiiscan.exe b/bin/wiiscan.exe deleted file mode 100644 index 9e9e443..0000000 Binary files a/bin/wiiscan.exe and /dev/null differ diff --git a/bin/wiiscan.ini b/bin/wiiscan.ini deleted file mode 100644 index 58226ee..0000000 --- a/bin/wiiscan.ini +++ /dev/null @@ -1,82 +0,0 @@ -% Configfile_begin - % config file for wiiscan - - % all usb device ids, not used yet in the scanning - all_usb_hubs="" - - % single power controlling usb hub, only nessesary when powerering over usb, for automatic resetting. If not used, put "" - % active_usb_hub="@PCI\VEN_8086&DEV_2934&SUBSYS_20F017AA&REV_03\3&B1BFB68&0&E8" - active_usb_hub="" - - % a list of allowed wiimotes in the form xx:xx:xx:xx:xx:xx, wildcard match is 00:00:00:00:00:00 - allowed_wiimote_adr=00:00:00:00:00:00 - % my set of wiimotes - %allowed_wiimote_adr=00:19:?D:??:6?:?? 00:1F:C5:??:??:?? - - % launching exe file have a problem with spaces, hence renamed exe, replaced space with underscores - % The original Johnny Chung Lee wb software version 0.3, downloaded from [http://johnnylee.net/projects/wii/] - %whiteboard_software="d:/WiimoteWhiteboard/WiimoteWhiteboard_v0.3.exe" - - % same stuff, but binary build from sources and redistributed in this package - %whiteboard_software="WiimoteWhiteboard.exe" - - % and finally, a custom build v0.3 version, with fixed calibration.dat write - whiteboard_software=WiimoteWhiteboard_v0.3.exe - - % Boon Jin's wb software version 0.6 - %whiteboard_software="d:/wsb/WiimoteSmoothboard.exe" - - % wiiscan parameters - %option_device="Nintendo RVL-CNT-01" - - % number of bt scanning attempts in a autoscan, timout is increased for every scan as retryattempt*option_timeout - %option_scanretries=3 - - % long time (4000 and above, or increase option_scanretries) when matching name, short (1000-2000) when matching address - option_timeout=4000 - - % wiimote scanning time, only applicable used for wiilib - option_wiitimeout=1000 - - % delay bewteen powerdown/up, see man for details - option_usbsleep=1000 - option_usbmsleep=1000 - %option_btsleep=2000 - - % output verbose flag, 0 or 1 - option_debug=0 - - % start wb at successfull connect, 0 or 1 - option_startwhiteboard=1 - - % logging output file, typical wiiscan_log.txt , put nothing if no logging is wanted - option_logfile= - - % wiimote connection library, use none, wiiuse, or wiimotelib - option_wiilib=wiimotelib - - % 0=no power cycle, 1=USB hub control, 2=USBm IO, 3=USB Devcon - option_usbpowermode=3 - - % 0=remove if not connectable, 1=always remove, 2=never remove - %option_forceremove=0 - - % bt radio to use, not working yet - %option_btradio=00:50:B6:A0:48:8C - - % wiiscantray options - % number of connection attempts before autoscan i restarted - option_tray_pool_retries=2 - - % retry sleep, keep it low (<1000) to catch an open connection - option_tray_sleep_between_pool_retries=250 - - % sleep bewteen polls, when wiimote is succeful connected, keep it hight (>2000) to avoid to much CPU usage - option_tray_sleep_between_pool_loops=1000 - - % final connection step reqires some sleep before windows PnP is ready - option_sleep_before_final_connect=1500 - - % delay after launch of wb software, keep it at a medium value (2000-10000) - option_sleep_after_startwhiteboard=4000 -% Configfile_end diff --git a/bin/wiiscantray.exe b/bin/wiiscantray.exe deleted file mode 100644 index 3560a01..0000000 Binary files a/bin/wiiscantray.exe and /dev/null differ diff --git a/bin/wiiuse.dll b/bin/wiiuse.dll deleted file mode 100644 index a7e228c..0000000 Binary files a/bin/wiiuse.dll and /dev/null differ diff --git a/build.gradle b/build.gradle index 3bcf8ce..d26d6e0 100644 --- a/build.gradle +++ b/build.gradle @@ -11,12 +11,11 @@ repositories { } dependencies { - compile 'com.github.boukefalos:jlibloader:0.2' - testCompile 'junit:junit:4.11' + compile 'com.github.boukefalos:jlibloader:0.3' } group = 'com.github.boukefalos' -project.archivesBaseName = 'wiiscan' +project.archivesBaseName = 'jlibwiiscan' version = '0.9' task wrapper(type: Wrapper) { @@ -50,16 +49,7 @@ model { List getStaticLibraryArchiverArgs() { [] } }) } - } - repositories { - libs(PrebuiltLibraries) { - usb { lib -> - binaries.withType(StaticLibraryBinary) { - staticLibraryFile = file("lib/${targetPlatform.name}/libusb-1.0.dll") - } - } - } - } + } } libraries { @@ -69,7 +59,6 @@ libraries { all { binaries.all { linker.args '-Wl,--kill-at', '-static-libgcc', '-static-libstdc++' - // lib library: 'usb', linkage: 'static' } } } @@ -113,8 +102,9 @@ binaries.withType(SharedLibraryBinary) { binary -> def builderTask = binary.tasks.builder def libraryDirectory = project.group.replace('.', '/') + "/${project.archivesBaseName}/${variantName}" nativeJar.into(libraryDirectory) { - from builderTask.outputFile - from file("lib/${targetPlatform.name}/libusb0.dll") + from builderTask.outputFile + from file("bin/wiiscan.exe") + from file("bin/DelcomDLL.dll") } // nativeJar.dependsOn builderTask } @@ -131,10 +121,18 @@ mainPom.withXml { provider -> def dep = deps.appendNode('dependency') dep.appendNode('groupId', project.group) dep.appendNode('artifactId', "${project.archivesBaseName}-${platform}") - dep.appendNode('version', jniVersion) - } + dep.appendNode('version', version) + } def dep = deps.appendNode('dependency') dep.appendNode('groupId', 'com.github.boukefalos') dep.appendNode('artifactId', 'jlibloader') dep.appendNode('version', '0.3') + dep = deps.appendNode('dependency') + dep.appendNode('groupId', 'com.github.boukefalos') + dep.appendNode('artifactId', 'libwiiuse') + dep.appendNode('version', '0.15') +} + +jar { + from sourceSets.main.allSource } \ No newline at end of file diff --git a/src/main/java/wiiscan/Wiiscan.java b/src/main/java/wiiscan/Wiiscan.java new file mode 100644 index 0000000..08dfef8 --- /dev/null +++ b/src/main/java/wiiscan/Wiiscan.java @@ -0,0 +1,10 @@ +package wiiscan; + +import com.github.boukefalos.jlibloader.Native; + +public class Wiiscan { + public static void load() { + Native.load("com.github.boukefalos", "jlibwiiscan", "DelcomDLL"); + Native.binary("com.github.boukefalos", "jlibwiiscan", "sox"); + } +} \ No newline at end of file