<artifactId>scsi2sd-util</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
+ <module>scsi2sd.io.usb4java</module>
<module>scsi2sd.io</module>
<module>scsi2sd.ui</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <libusb4java.version>1.3.0</libusb4java.version>
+
</properties>
<build>
</plugin>
- <!--<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>3.1.1</version>
+ <plugin>
+ <groupId>org.moditect</groupId>
+ <artifactId>moditect-maven-plugin</artifactId>
+ <version>1.0.0.RC1</version>
<executions>
<execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
+ <id>add-module-infos</id>
+ <phase>generate-resources</phase>
<goals>
- <goal>copy-dependencies</goal>
+ <goal>add-module-info</goal>
</goals>
+
<configuration>
<outputDirectory>${project.build.directory}/install</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>false</overWriteSnapshots>
- <overWriteIfNewer>true</overWriteIfNewer>
- <excludeGroupIds>org.hid4java,net.java.dev.jna</excludeGroupIds>
- <excludeScope>test</excludeScope>
+ <modules>
+ <module>
+ <artifact>
+ <groupId>org.hid4java</groupId>
+ <artifactId>hid4java</artifactId>
+ <version>0.5.0</version>
+ </artifact>
+ <moduleInfoSource>
+ open module hid4java {
+ requires jna;
+ exports org.hid4java;
+ exports org.hid4java.jna to jna;
+ exports org.hid4java.event to com.codesrc.scsi2sd.io;
+
+ // native libraries. Use jimage on the jlink'd module file
+ // to list the relevant directories (which get
+ // turned into packages)
+ // (disabled and open'd entire module because the
+ // hyphen in the directory names causes parse problems)
+ //exports darwin;
+ //exports win32-amd64;
+ //exports linux-amd64;
+ //exports linux-x86-64;
+ }
+ </moduleInfoSource>
+ </module>
+
+ <module>
+ <artifact>
+ <groupId>net.java.dev.jna</groupId>
+ <artifactId>jna</artifactId>
+ <version>5.5.0</version>
+ </artifact>
+ <moduleInfoSource>
+ // Open is required to access the native library resources
+ open module jna {
+ exports com.sun.jna;
+ requires java.logging;
+ }
+ </moduleInfoSource>
+ </module>
+
+ <module>
+ <artifact>
+ <groupId>javax.usb</groupId>
+ <artifactId>usb-api</artifactId>
+ <version>1.0.2</version>
+ </artifact>
+ <moduleInfoSource>
+ module usb.api {
+ exports javax.usb;
+ exports javax.usb.event;
+ }
+ </moduleInfoSource>
+ </module>
+
+ <module>
+ <artifact>
+ <groupId>org.usb4java</groupId>
+
+ <artifactId>usb4java-javax</artifactId>
+ <version>1.3.0</version>
+ </artifact>
+ <moduleInfoSource>
+ module usb4java.javax {
+ exports org.usb4java.javax;
+ requires usb.api;
+ requires com.codesrc.scsi2sd.io.usb4java;
+ requires org.apache.commons.lang3;
+ }
+ </moduleInfoSource>
+ </module>
+
+ <module>
+ <artifact>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.8.1</version>
+ </artifact>
+ <moduleInfoSource>
+ module org.apache.commons.lang3 {
+ exports org.apache.commons.lang3;
+ exports org.apache.commons.lang3.builder;
+ }
+ </moduleInfoSource>
+ </module>
+ </modules>
</configuration>
+
</execution>
</executions>
- </plugin>-->
-
- <plugin>
- <groupId>org.moditect</groupId>
- <artifactId>moditect-maven-plugin</artifactId>
- <version>1.0.0.Beta2</version>
- <executions>
- <execution>
- <id>add-module-infos</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>add-module-info</goal>
- </goals>
-
- <configuration>
- <outputDirectory>${project.build.directory}/install</outputDirectory>
- <modules>
- <module>
- <artifact>
- <groupId>org.hid4java</groupId>
- <artifactId>hid4java</artifactId>
- <version>0.5.0</version>
- </artifact>
- <moduleInfoSource>
- open module hid4java {
- requires jna;
- exports org.hid4java;
- exports org.hid4java.jna to jna;
- exports org.hid4java.event to com.codesrc.scsi2sd.io;
-
- // native libraries. Use jimage on the jlink'd module file
- // to list the relevant directories (which get
- // turned into packages)
- // (disabled and open'd entire module because the
- // hyphen in the directory names causes parse problems)
- //exports darwin;
- //exports win32-amd64;
- //exports linux-amd64;
- //exports linux-x86-64;
- }
- </moduleInfoSource>
- </module>
-
- <module>
- <artifact>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna</artifactId>
- <version>5.5.0</version>
- </artifact>
- <moduleInfoSource>
- // Open is required to access the native library resources
- open module jna {
- exports com.sun.jna;
- requires java.logging;
- }
- </moduleInfoSource>
- </module>
- </modules>
- </configuration>
-
- </execution>
- </executions>
- </plugin>
+ </plugin>
</plugins>
</build>
<dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.8.0-beta2</version>
- </dependency>
-
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna</artifactId>
- <version>5.2.0</version>
- </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.8.0-beta2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.java.dev.jna</groupId>
+ <artifactId>jna</artifactId>
+ <version>5.2.0</version>
+ </dependency>
<dependency>
<groupId>org.hid4java</groupId>
<artifactId>hid4java</artifactId>
<version>0.5.0</version>
- <exclusions>
- <exclusion> <!-- declare the exclusion here -->
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna</artifactId>
- </exclusion>
- </exclusions>
+ <exclusions>
+ <exclusion> <!-- declare the exclusion here -->
+ <groupId>net.java.dev.jna</groupId>
+ <artifactId>jna</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>com.codesrc</groupId>
+ <artifactId>scsi2sd.io.usb4java</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- dependency is really for usb4java, not included in shade'd jar -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.usb</groupId>
+ <artifactId>usb-api</artifactId>
+ <version>1.0.2</version>
+ </dependency>
+
+ <!-- For using usb4java with javax-usb -->
+ <dependency>
+ <groupId>org.usb4java</groupId>
+ <artifactId>usb4java-javax</artifactId>
+ <version>1.3.0</version>
</dependency>
<dependency>
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.8.0-beta2" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.2.0" level="project" />
<orderEntry type="library" name="Maven: org.hid4java:hid4java:0.5.0" level="project" />
+ <orderEntry type="module" module-name="scsi2sd.io.usb4java" />
+ <orderEntry type="library" name="Maven: org.usb4java:usb4java:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:libusb4java:linux-x86:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:libusb4java:linux-x86-64:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:libusb4java:win32-x86:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:libusb4java:win32-x86-64:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:libusb4java:darwin-x86-64:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:libusb4java:linux-arm:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:libusb4java:linux-aarch64:1.3.0" level="project" />
+ <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: javax.usb:usb-api:1.0.2" level="project" />
+ <orderEntry type="library" name="Maven: org.usb4java:usb4java-javax:1.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component>
import org.hid4java.*;
import org.hid4java.event.HidServicesEvent;
import org.slf4j.LoggerFactory;
+import javax.usb.*;
+import javax.usb.event.UsbServicesEvent;
+import javax.usb.event.UsbServicesListener;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.*;
-class UsbDeviceManagerImpl implements UsbDeviceManager, HidServicesListener {
+class UsbDeviceManagerImpl implements UsbDeviceManager, HidServicesListener, UsbServicesListener {
private static org.slf4j.Logger LOGGER = LoggerFactory.getLogger(UsbDeviceManagerImpl.class.getPackageName());
private static UsbDeviceManagerImpl INSTANCE = new UsbDeviceManagerImpl();
private HidServices hidServices;
- private Map<HidDevice, UsbDevice> devices = new ConcurrentHashMap<>();
+ private Map<HidDevice, UsbDevice> hidDevices = new ConcurrentHashMap<>();
+
+ private UsbServices usbServices;
public static UsbDeviceManager getInstance() {
return INSTANCE;
hidServices.getAttachedHidDevices().forEach(d -> this.attached(d));
hidServices.addHidServicesListener(this);
+ try {
+ usbServices = UsbHostManager.getUsbServices();
+ usbServices.addUsbServicesListener(this);
+ } catch (UsbException e) {
+ throw new RuntimeException(e);
+ }
+
scheduler.scheduleWithFixedDelay(() -> this.poll(), 1, 1, TimeUnit.SECONDS);
LOGGER.debug("Initialised UsbDeviceManagerImpl");
@Override
public List<UsbDevice> getDevices() {
- return new ArrayList<>(devices.values());
+ return new ArrayList<>(hidDevices.values());
}
private void poll() {
} catch (Exception e) {
LOGGER.error("Exception in UsbDeviceManagerImpl.hidDeviceDettached", e);
}
+ }
+
+ @Override
+ public void usbDeviceAttached(UsbServicesEvent usbServicesEvent) {
+
+ }
+
+ @Override
+ public void usbDeviceDetached(UsbServicesEvent usbServicesEvent) {
}
}
private void detached(HidDevice hidDevice) {
- UsbDevice attachedDevice = devices.get(hidDevice);
+ UsbDevice attachedDevice = hidDevices.get(hidDevice);
if (attachedDevice != null) {
- devices.remove(attachedDevice);
+ hidDevices.remove(attachedDevice);
LOGGER.info("Detached SCSI2SD");
}
private void attached(HidDevice hidDevice) {
- if (devices.containsKey(hidDevice)) {
+ if (hidDevices.containsKey(hidDevice)) {
// Why are we getting this again ?
LOGGER.warn("Usb Device duplicate attach {}", hidDevice.getPath());
return;
}
- if (!devices.isEmpty()) {
+ if (!hidDevices.isEmpty()) {
// UI only supports one device for now
return;
}
hidDevice.getProductId() == V6FirmwareUsbDevice.PRODUCT_ID) {
attachedDevice = new V6FirmwareUsbDevice(hidDevice);
- this.devices.put(hidDevice, attachedDevice);
+ this.hidDevices.put(hidDevice, attachedDevice);
} else if (hidDevice.getVendorId() == V3FirmwareUsbDevice.VENDOR_ID &&
hidDevice.getProductId() == V3FirmwareUsbDevice.PRODUCT_ID) {
if (dbgDev.getVendorId() == V3FirmwareUsbDevice.VENDOR_ID &&
dbgDev.getProductId() == V3FirmwareUsbDevice.PRODUCT_ID &&
(dbgDev.getInterfaceNumber() == 1 || hidDevice.getUsagePage() == (short) 0xFF01) &&
- !this.devices.containsKey(dbgDev)) {
+ !this.hidDevices.containsKey(dbgDev)) {
attachedDevice = new V3FirmwareUsbDevice(hidDevice, dbgDev);
- this.devices.put(dbgDev, attachedDevice);
- this.devices.put(hidDevice, attachedDevice);
+ this.hidDevices.put(dbgDev, attachedDevice);
+ this.hidDevices.put(hidDevice, attachedDevice);
}
}
if (cfgDev.getVendorId() == V3FirmwareUsbDevice.VENDOR_ID &&
cfgDev.getProductId() == V3FirmwareUsbDevice.PRODUCT_ID &&
(cfgDev.getInterfaceNumber() == 0 || hidDevice.getUsagePage() == (short) 0xFF00) &&
- !this.devices.containsKey(cfgDev)) {
+ !this.hidDevices.containsKey(cfgDev)) {
attachedDevice = new V3FirmwareUsbDevice(cfgDev, hidDevice);
- this.devices.put(cfgDev, attachedDevice);
- this.devices.put(hidDevice, attachedDevice);
+ this.hidDevices.put(cfgDev, attachedDevice);
+ this.hidDevices.put(hidDevice, attachedDevice);
}
}
}
throw e;
}
}
+
+
+ private javax.usb.UsbDevice findDevice(UsbHub hub, short vendorId, short productId)
+ {
+ for (javax.usb.UsbDevice device : (List<javax.usb.UsbDevice>) hub.getAttachedUsbDevices())
+ {
+ UsbDeviceDescriptor desc = device.getUsbDeviceDescriptor();
+ if (desc.idVendor() == vendorId && desc.idProduct() == productId) return device;
+ if (device.isUsbHub())
+ {
+ device = findDevice((UsbHub) device, vendorId, productId);
+ if (device != null) return device;
+ }
+ }
+ return null;
+ }
}
return "3.5\" SCSI2SD V5.1";
//info.version = "V5.1";
//info.firmwareName = "SCSI2SD-V51.cyacd";
+ case 0x3004:
+ return "3.5\" SCSI2SD V5.2";
+ //info.version = "V5.2";
+ //info.firmwareName = "SCSI2SD-V52.cyacd";
case 0x0055:
return "External DB25 SCSI2SD";
//info.version = "V5.5";
module com.codesrc.scsi2sd.io {
requires hid4java;
+ requires usb.api;
+ requires com.codesrc.scsi2sd.io.usb4java;
+ requires usb4java.javax;
requires org.slf4j;
exports com.codesrc.scsi2sd.io;
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
- <profiles>
- <profile>
- <id>linux</id>
- <activation>
- <os>
- <family>unix</family>
- <name>Linux</name>
- </os>
- </activation>
- <properties>
- <jmodPath>${project.build.directory}/../../build/linux/javafx-jmods-11.0.2</jmodPath>
- </properties>
- </profile>
- <profile>
- <id>mac</id>
- <activation>
- <os>
- <family>mac</family>
- </os>
- </activation>
- <properties>
- <jmodPath>${project.build.directory}/../../build/mac/javafx-jmods-11.0.2</jmodPath>
- </properties>
- </profile>
- <profile>
- <id>windows</id>
- <activation>
- <os>
- <family>windows</family>
- </os>
- </activation>
- <properties>
- <jmodPath>${project.build.directory}/../../build/windows/javafx-jmods-11.0.2</jmodPath>
- </properties>
- </profile>
- </profiles>
+ <profiles>
+ <profile>
+ <id>linux</id>
+ <activation>
+ <os>
+ <family>unix</family>
+ <name>Linux</name>
+ </os>
+ </activation>
+ <properties>
+ <jmodPath>${project.build.directory}/../../build/linux/javafx-jmods-11.0.2</jmodPath>
+ </properties>
+ </profile>
+ <profile>
+ <id>mac</id>
+ <activation>
+ <os>
+ <family>mac</family>
+ </os>
+ </activation>
+ <properties>
+ <jmodPath>${project.build.directory}/../../build/mac/javafx-jmods-11.0.2</jmodPath>
+ </properties>
+ </profile>
+ <profile>
+ <id>windows</id>
+ <activation>
+ <os>
+ <family>windows</family>
+ </os>
+ </activation>
+ <properties>
+ <jmodPath>${project.build.directory}/../../build/windows/javafx-jmods-11.0.2</jmodPath>
+ </properties>
+ </profile>
+ </profiles>
<build>
<directory>target</directory>
<resource>
<directory>src/main/resources</directory>
</resource>
-
</resources>
<plugins>
<target>10</target>
</configuration>
</plugin>
- <plugin>
- <!-- Build an executable JAR -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.1.1</version>
- <configuration>
- <archive>
- <manifest>
- <!-- <addClasspath>true</addClasspath> -->
- <mainClass>com.codesrc.scsi2sd.App</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
+ <plugin>
+ <!-- Build an executable JAR -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.1.1</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <!-- <addClasspath>true</addClasspath> -->
+ <mainClass>com.codesrc.scsi2sd.App</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
- <excludeGroupIds>org.openjfx,org.hid4java,net.java.dev.jna</excludeGroupIds>
+ <excludeGroupIds>org.openjfx,org.hid4java,net.java.dev.jna,javax.usb,org.usb4java,org.apache.commons</excludeGroupIds>
</configuration>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.moditect</groupId>
+ <artifactId>moditect-maven-plugin</artifactId>
+ <version>1.0.0.RC1</version>
+ <executions>
+ <execution>
+ <id>add-module-infos</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>add-module-info</goal>
+ </goals>
- <plugin>
- <groupId>org.moditect</groupId>
- <artifactId>moditect-maven-plugin</artifactId>
- <version>1.0.0.Beta2</version>
- <executions>
- <execution>
- <id>add-module-infos</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>add-module-info</goal>
- </goals>
-
- <configuration>
- <outputDirectory>${project.build.directory}/install</outputDirectory>
- <modules>
- <module>
- <artifact>
- <groupId>net.sf.jopt-simple</groupId>
- <artifactId>jopt-simple</artifactId>
- <version>6.0-alpha-3</version>
- </artifact>
- <moduleInfoSource>
- module joptsimple {
- exports joptsimple;
- }
- </moduleInfoSource>
- </module>
- </modules>
- </configuration>
- </execution>
+ <configuration>
+ <outputDirectory>${project.build.directory}/install</outputDirectory>
+ <modules>
+ <module>
+ <artifact>
+ <groupId>net.sf.jopt-simple</groupId>
+ <artifactId>jopt-simple</artifactId>
+ <version>6.0-alpha-3</version>
+ </artifact>
+ <moduleInfoSource>
+ module joptsimple {
+ exports joptsimple;
+ }
+ </moduleInfoSource>
+ </module>
+ </modules>
+ </configuration>
+ </execution>
- <execution>
- <id>create-runtime-image</id>
- <phase>package</phase>
- <goals>
- <goal>create-runtime-image</goal>
- </goals>
- <configuration>
- <modulePath>
- <path>${project.build.directory}/scsi2sd.ui-1.0-SNAPSHOT.jar</path>
- <path>${jmodPath}</path>
- <path>${project.build.directory}/../../scsi2sd.io/target/install</path>
- <path>${project.build.directory}/install</path>
- </modulePath>
- <modules>
- <module>com.codesrc.scsi2sd.ui</module>
- </modules>
- <excludedResources>
- </excludedResources>
- <!--<baseJdk>version=11,vendor=openjdk,platform=linux-x64</baseJdk>-->
- <launcher>
- <name>scsi2sd-util</name>
- <module>com.codesrc.scsi2sd.ui/com.codesrc.scsi2sd.App</module>
- </launcher>
- <outputDirectory>
- ${project.build.directory}/jlink-image
- </outputDirectory>
- <stripDebug>true</stripDebug>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <execution>
+ <id>create-runtime-image</id>
+ <phase>package</phase>
+ <goals>
+ <goal>create-runtime-image</goal>
+ </goals>
+ <configuration>
+ <modulePath>
+ <path>${project.build.directory}/scsi2sd.ui-1.0-SNAPSHOT.jar</path>
+ <path>${jmodPath}</path>
+ <path>${project.build.directory}/../../scsi2sd.io/target/install</path>
+ <path>${project.build.directory}/install</path>
+ </modulePath>
+ <modules>
+ <module>com.codesrc.scsi2sd.ui</module>
+ </modules>
+ <excludedResources>
+ </excludedResources>
+ <!--<baseJdk>version=11,vendor=openjdk,platform=linux-x64</baseJdk>-->
+ <launcher>
+ <name>scsi2sd-util</name>
+ <module>com.codesrc.scsi2sd.ui/com.codesrc.scsi2sd.App</module>
+ </launcher>
+ <outputDirectory>
+ ${project.build.directory}/jlink-image
+ </outputDirectory>
+ <stripDebug>true</stripDebug>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
System.out.println(
"SCSI2SD Utility v" + appProperties.getProperty("com.codesrc.scsi2sd.app.version") + "\n" +
- "Copyright (C) 2019 Michael McMaster <michael@codesrc.com>\n" +
+ "Copyright (C) 2019-2020 Michael McMaster <michael@codesrc.com>\n" +
"\n" +
"This program is free software: you can redistribute it and/or modify\n" +
"it under the terms of the GNU General Public License as published by\n" +
this.flags6.add(Flag6.S2S_CFG_ENABLE_TERMINATOR);
}
+ public boolean isEnableBlindWrites() {
+ return flags6.contains(Flag6.S2S_CFG_ENABLE_BLIND_WRITES);
+ }
+
+ public void setEnableBlindWrites(boolean enableBlindWrites) {
+ this.flags6.add(Flag6.S2S_CFG_ENABLE_BLIND_WRITES);
+ }
+
public BoardConfig(Node node) {
var childNodes = node.getChildNodes();
var children = IntStream.range(0, childNodes.getLength())
this.flags6.add(Flag6.S2S_CFG_ENABLE_TERMINATOR);
}
+ if (children.getOrDefault("blindWrites", "false").equalsIgnoreCase("true")) {
+ this.flags6.add(Flag6.S2S_CFG_ENABLE_BLIND_WRITES);
+ }
+
this.selectionDelay = 255;
var selDelayText = children.getOrDefault("selectionDelay", "255");
try {
.append(" 5 Sync 10MB/s\n")
.append(" ********************************************************* -->\n")
.append(" <scsiSpeed>").append(this.scsiSpeed.getValue()).append("</scsiSpeed>\n")
+
+ .append(" <!-- ********************************************************\n")
+ .append(" Enable SD card blind writes, which starts writing to the SD\n")
+ .append(" card before all the SCSI data has been received. Can cause problems\n")
+ .append(" with some SCSI hosts\n")
+ .append(" ********************************************************* -->\n")
+ .append(" <blindWrites>")
+ .append(this.flags6.contains(Flag6.S2S_CFG_ENABLE_BLIND_WRITES) ? "true" : "false")
+ .append(" </blindWrites>\n")
.append("</S2S_BoardCfg>\n");
return out.toString();
import java.util.Set;
public enum Flag6 implements BitEnum {
- S2S_CFG_ENABLE_TERMINATOR(1);
+ S2S_CFG_ENABLE_TERMINATOR(1),
+ S2S_CFG_ENABLE_BLIND_WRITES(2);
static Set<Flag6> fromBitmask(byte bitmask) {
Set<Flag6> result = new HashSet<>();
@FXML private ToggleSwitch cfgScsi2;
@FXML private ToggleSwitch cfgSelPulses;
@FXML private ToggleSwitch cfgMapLuns;
+ @FXML private ToggleSwitch cfgEnableBlindWrites;
@FXML private ChoiceBox speedLimit;
this.cfgScsi2.selectedProperty().addListener(it -> this.setFlag(Flag.S2S_CFG_ENABLE_SCSI2, this.cfgScsi2));
this.cfgSelPulses.selectedProperty().addListener(it -> this.setFlag(Flag.S2S_CFG_ENABLE_SEL_LATCH, this.cfgSelPulses));
this.cfgMapLuns.selectedProperty().addListener(it -> this.setFlag(Flag.S2S_CFG_MAP_LUNS_TO_IDS, this.cfgMapLuns));
+ this.cfgEnableBlindWrites.selectedProperty().addListener(it -> this.setBlindWrites());
this.speedLimit.getItems().addAll(Speed.values());
this.speedLimit.setOnAction(e -> this.setSpeedLimit());
cfgScsi2.setSelected(this.boardConfig.getFlags().contains(Flag.S2S_CFG_ENABLE_SCSI2));
cfgSelPulses.setSelected(this.boardConfig.getFlags().contains(Flag.S2S_CFG_ENABLE_SEL_LATCH));
cfgMapLuns.setSelected(this.boardConfig.getFlags().contains(Flag.S2S_CFG_MAP_LUNS_TO_IDS));
+ cfgEnableBlindWrites.setSelected(this.boardConfig.isEnableBlindWrites());
this.speedLimit.setValue(this.boardConfig.getScsiSpeed());
}
}
}
+ private void setBlindWrites()
+ {
+ if (this.boardConfig != null)
+ {
+ this.boardConfig.setFlag6(Flag6.S2S_CFG_ENABLE_BLIND_WRITES, this.cfgEnableBlindWrites.isSelected());
+ this.activeDocument.setModified(this.getClass().getName(), true);
+ }
+ }
+
private void setStartupDelay()
{
if (this.boardConfig != null)
-com.codesrc.scsi2sd.app.version = 1.0-BETA
+com.codesrc.scsi2sd.app.version = 1.1
com.codesrc.scsi2sd.app.licence.type = GPLv3
com.codesrc.scsi2sd.app.licence.url = https://www.gnu.org/licenses/gpl-3.0.html
</font>
</Label>
- <Label>Copyright 2019 Michael McMaster [michael@codesrc.com]</Label>
+ <Label>Copyright 2019-2020 Michael McMaster [michael@codesrc.com]</Label>
<Label text="Version: " fx:id="labelVersion"/>
<Hyperlink fx:id="licenceLink"><text>Licence: GPLv3</text></Hyperlink>
<RowConstraints maxHeight="60.0" minHeight="15.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="60.0" minHeight="15.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="60.0" minHeight="15.0" prefHeight="30.0" vgrow="SOMETIMES" />
+ <RowConstraints maxHeight="60.0" minHeight="15.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Enable Active Terminator" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Map LUNS to IDs" GridPane.columnIndex="1" GridPane.rowIndex="11" />
<ToggleSwitch fx:id="cfgMapLuns" mnemonicParsing="false" GridPane.rowIndex="11" />
+ <Label text="Blind Writes" GridPane.columnIndex="1" GridPane.rowIndex="12" />
+ <ToggleSwitch fx:id="cfgEnableBlindWrites" mnemonicParsing="false" GridPane.rowIndex="12" />
+
<Label text="Default" GridPane.columnIndex="2">
<font>
<Font name="System Bold" size="13.0" />
<Label text="Disabled" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label text="Disabled" GridPane.columnIndex="2" GridPane.rowIndex="10" />
<Label text="Disabled" GridPane.columnIndex="2" GridPane.rowIndex="11" />
+ <Label text="Disabled" GridPane.columnIndex="2" GridPane.rowIndex="12" />
<Label text="Advanced" GridPane.columnIndex="1" GridPane.rowIndex="9">
<font>
<Font name="System Bold" size="13.0" />
</children>
</VBox>
</content>
-</ScrollPane>
\ No newline at end of file
+</ScrollPane>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="600"
- height="300"
- viewBox="0 0 158.75 79.375002"
- version="1.1"
- id="svg8"
- inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
- sodipodi:docname="splash.svg"
- inkscape:export-filename="/home/michael/projects/scsi2sd-util/scsi2sd.ui/src/main/resources/img/splash.png"
+ inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
- inkscape:export-ydpi="96">
+ inkscape:export-filename="/home/michael/projects/scsi2sd-util/scsi2sd.ui/src/main/resources/img/splash.png"
+ sodipodi:docname="splash.svg"
+ inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
+ id="svg8"
+ version="1.1"
+ viewBox="0 0 158.75 79.375002"
+ height="300"
+ width="600">
<defs
id="defs2" />
<sodipodi:namedview
- id="base"
- pagecolor="#646464"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="224.74084"
- inkscape:cy="234.28571"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- units="px"
- inkscape:pagecheckerboard="false"
- inkscape:window-width="2560"
- inkscape:window-height="1376"
- inkscape:window-x="0"
+ inkscape:document-rotation="0"
+ inkscape:window-maximized="1"
inkscape:window-y="27"
- inkscape:window-maximized="1" />
+ inkscape:window-x="0"
+ inkscape:window-height="1376"
+ inkscape:window-width="2560"
+ inkscape:pagecheckerboard="false"
+ units="px"
+ showgrid="false"
+ inkscape:current-layer="layer1"
+ inkscape:document-units="px"
+ inkscape:cy="158.92857"
+ inkscape:cx="224.74084"
+ inkscape:zoom="1.4"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#646464"
+ id="base" />
<metadata
id="metadata5">
<rdf:RDF>
</rdf:RDF>
</metadata>
<g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
+ transform="translate(0,-217.62498)"
id="layer1"
- transform="translate(0,-217.62498)">
+ inkscape:groupmode="layer"
+ inkscape:label="Layer 1">
<text
- xml:space="preserve"
- style="font-style:normal;font-weight:normal;font-size:3.17499995px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#c8c8c8;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- x="5.2941761"
+ id="text1368"
y="234.63391"
- id="text1368"><tspan
- sodipodi:role="line"
- x="5.2941761"
+ x="5.2941761"
+ style="font-style:normal;font-weight:normal;font-size:3.175px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#c8c8c8;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ id="tspan1374"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.2889px;font-family:Sans;-inkscape-font-specification:'Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#c8c8c8;fill-opacity:1;stroke-width:0.264583px"
y="234.63391"
- style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.28888893px;font-family:Sans;-inkscape-font-specification:'Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#c8c8c8;fill-opacity:1;stroke-width:0.26458332px"
- id="tspan1374">SCSI2SD</tspan></text>
+ x="5.2941761"
+ sodipodi:role="line">SCSI2SD</tspan></text>
<text
- xml:space="preserve"
- style="font-style:normal;font-weight:normal;font-size:3.17500019px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#c8c8c8;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- x="5.943749"
+ id="text1372"
y="244.27229"
- id="text1372"><tspan
- sodipodi:role="line"
- id="tspan1370"
- x="5.943749"
+ x="5.943749"
+ style="font-style:normal;font-weight:normal;font-size:3.175px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#c8c8c8;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ style="fill:#c8c8c8;fill-opacity:1;stroke-width:0.264583px"
y="244.27229"
- style="fill:#c8c8c8;fill-opacity:1;stroke-width:0.26458335px">Configuration and Firmware Update Utility</tspan><tspan
- sodipodi:role="line"
x="5.943749"
+ id="tspan1370"
+ sodipodi:role="line">Configuration and Firmware Update Utility</tspan><tspan
+ id="tspan1408"
+ style="fill:#c8c8c8;fill-opacity:1;stroke-width:0.264583px"
y="248.24104"
- style="fill:#c8c8c8;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1408">v1.0-BETA</tspan></text>
+ x="5.943749"
+ sodipodi:role="line">v1.1</tspan></text>
<text
- xml:space="preserve"
- style="font-style:normal;font-weight:normal;font-size:3.17500019px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- x="5.291667"
+ id="text1380"
y="272.9985"
- id="text1380"><tspan
- sodipodi:role="line"
- id="tspan1378"
- x="5.291667"
- y="275.80765"
- style="stroke-width:0.26458335px" /></text>
+ x="5.291667"
+ style="font-style:normal;font-weight:normal;font-size:3.175px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve" />
<text
- xml:space="preserve"
- style="font-style:normal;font-weight:normal;font-size:3.17500019px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#969696;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- x="6.0476184"
+ id="text1384"
y="254.47769"
- id="text1384"><tspan
- sodipodi:role="line"
- x="6.0476184"
+ x="6.0476184"
+ style="font-style:normal;font-weight:normal;font-size:3.175px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#969696;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ id="tspan1386"
+ style="fill:#969696;fill-opacity:1;stroke-width:0.264583px"
y="254.47769"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1386">scsi2sd-util Copyright © 2019 Michael McMaster</tspan><tspan
- sodipodi:role="line"
x="6.0476184"
+ sodipodi:role="line">scsi2sd-util Copyright © 2019-2020 Michael McMaster</tspan><tspan
+ id="tspan1406"
y="258.44644"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1406" /><tspan
- sodipodi:role="line"
x="6.0476184"
+ sodipodi:role="line" /><tspan
+ id="tspan1388"
+ style="fill:#969696;fill-opacity:1;stroke-width:0.264583px"
y="262.41519"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1388">This program comes with ABSOLUTELY NO WARRANTY.</tspan><tspan
- sodipodi:role="line"
x="6.0476184"
+ sodipodi:role="line">This program comes with ABSOLUTELY NO WARRANTY.</tspan><tspan
+ id="tspan1392"
+ style="fill:#969696;fill-opacity:1;stroke-width:0.264583px"
y="266.38394"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1392">This program is free software: you can redistribute it and/or modify</tspan><tspan
- sodipodi:role="line"
x="6.0476184"
+ sodipodi:role="line">This program is free software: you can redistribute it and/or modify</tspan><tspan
+ id="tspan1398"
+ style="fill:#969696;fill-opacity:1;stroke-width:0.264583px"
y="270.35269"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1398">it under the terms of the GNU General Public License as published by</tspan><tspan
- sodipodi:role="line"
x="6.0476184"
+ sodipodi:role="line">it under the terms of the GNU General Public License as published by</tspan><tspan
+ id="tspan1400"
+ style="fill:#969696;fill-opacity:1;stroke-width:0.264583px"
y="274.32144"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1400">the Free Software Foundation, either version 3 of the License, or</tspan><tspan
- sodipodi:role="line"
x="6.0476184"
+ sodipodi:role="line">the Free Software Foundation, either version 3 of the License, or</tspan><tspan
+ id="tspan1402"
+ style="fill:#969696;fill-opacity:1;stroke-width:0.264583px"
y="278.29019"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1402">(at your option) any later version.</tspan><tspan
- sodipodi:role="line"
x="6.0476184"
+ sodipodi:role="line">(at your option) any later version.</tspan><tspan
+ id="tspan1404"
y="282.25894"
- style="fill:#969696;fill-opacity:1;stroke-width:0.26458335px"
- id="tspan1404" /></text>
+ x="6.0476184"
+ sodipodi:role="line" /></text>
</g>
</svg>