Windows support implemented and tested.
This commit is contained in:
parent
f227adaac8
commit
bb87b72b91
2 changed files with 24 additions and 7 deletions
26
README.md
26
README.md
|
@ -9,7 +9,7 @@ Source code spreads under the GNU General Public License v.3. You can find it in
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
JRE 8 or higher.
|
JRE 8 or higher. See below.
|
||||||
|
|
||||||
## Used libraries
|
## Used libraries
|
||||||
* OpenJFX https://wiki.openjdk.java.net/display/OpenJFX/Main
|
* OpenJFX https://wiki.openjdk.java.net/display/OpenJFX/Main
|
||||||
|
@ -17,12 +17,29 @@ JRE 8 or higher.
|
||||||
* Few icons taken from: http://materialdesignicons.com/
|
* Few icons taken from: http://materialdesignicons.com/
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
Linux:
|
### Linux:
|
||||||
|
|
||||||
|
Install JRE/JDK 8 or higher (openJDK is good. Oracle's one is also good). JavaFX not needed, if you're interested (it's embedded).
|
||||||
|
|
||||||
`root # java -jar /path/to/NS-USBloader.jar`
|
`root # java -jar /path/to/NS-USBloader.jar`
|
||||||
|
|
||||||
|
### Windows:
|
||||||
|
|
||||||
|
* Download Zadig: https://zadig.akeo.ie/
|
||||||
|
* Open tinfoil. Set 'Title Managment' -> 'Usb install NSP'
|
||||||
|
* Connect NS to pc
|
||||||
|
* Open Zadig, select NS in dropdown, select 'libusbK (v3.0.7.0)' (version may vary), click 'Install WCID Driver'
|
||||||
|
* Check that in device list of you system you have 'libusbK USB Devices' folder and your NS inside of it
|
||||||
|
* Download and install Java JRE (8+)
|
||||||
|
* Get this application (JAR file) double-click on on it (alternatively open 'cmd', go to place where jar located and execute via 'java -jar thisAppName.jar')
|
||||||
|
* Remember to have fun!
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
Coming...
|
||||||
|
|
||||||
## Tips&tricks
|
## Tips&tricks
|
||||||
### Add user to udev rules to use NS non-root:
|
### Add user to udev rules to use NS non-root (Linux):
|
||||||
`root # vim /etc/udev/rules.d/99-NS.rules`
|
`root # vim /etc/udev/rules.d/99-NS.rules`
|
||||||
`SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", GROUP="plugdev"`
|
`SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", GROUP="plugdev"`
|
||||||
`root # udevadm control --reload-rules && udevadm trigger`
|
`root # udevadm control --reload-rules && udevadm trigger`
|
||||||
|
@ -32,4 +49,5 @@ Linux:
|
||||||
|
|
||||||
## TODO:
|
## TODO:
|
||||||
- [ ] macOS QA
|
- [ ] macOS QA
|
||||||
- [ ] Windows support
|
- [x] Windows support
|
||||||
|
- [ ] code refactoring
|
|
@ -336,7 +336,7 @@ class UsbCommunications extends Task<Void> {
|
||||||
* After we sent commands to NS, this chain starts
|
* After we sent commands to NS, this chain starts
|
||||||
* */
|
* */
|
||||||
private void proceedCommands(){
|
private void proceedCommands(){
|
||||||
printLog("Waiting for NS commands.", MsgType.INFO);
|
printLog("Awaiting for NS commands.", MsgType.INFO);
|
||||||
|
|
||||||
/* byte[] magic = new byte[4];
|
/* byte[] magic = new byte[4];
|
||||||
ByteBuffer bb = StandardCharsets.UTF_8.encode("TUC0").rewind().get(magic);
|
ByteBuffer bb = StandardCharsets.UTF_8.encode("TUC0").rewind().get(magic);
|
||||||
|
@ -565,7 +565,7 @@ class UsbCommunications extends Task<Void> {
|
||||||
IntBuffer readBufTransferred = IntBuffer.allocate(1);
|
IntBuffer readBufTransferred = IntBuffer.allocate(1);
|
||||||
|
|
||||||
int result;
|
int result;
|
||||||
result = LibUsb.bulkTransfer(handlerNS, (byte) 0x81, readBuffer, readBufTransferred, 0); // last one is TIMEOUT. 0 stands for unlimited. Endpoint IN = 0x81
|
result = LibUsb.bulkTransfer(handlerNS, (byte) 0x81, readBuffer, readBufTransferred, 5000); // last one is TIMEOUT. 0 stands for unlimited. Endpoint IN = 0x81
|
||||||
|
|
||||||
if (result != LibUsb.SUCCESS){
|
if (result != LibUsb.SUCCESS){
|
||||||
switch (result){
|
switch (result){
|
||||||
|
@ -588,7 +588,6 @@ class UsbCommunications extends Task<Void> {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
// DEBUG START----------------------------------------------------------------------------------------------
|
// DEBUG START----------------------------------------------------------------------------------------------
|
||||||
readBuffer.rewind();
|
|
||||||
int trans = readBufTransferred.get();
|
int trans = readBufTransferred.get();
|
||||||
byte[] receivedBytes = new byte[trans];
|
byte[] receivedBytes = new byte[trans];
|
||||||
readBuffer.get(receivedBytes);
|
readBuffer.get(receivedBytes);
|
||||||
|
|
Loading…
Reference in a new issue