Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,10 @@ public static class CompatibilityInfoForMaps{
private static final ShimmerVerObject svoShimmerGq802154Lr = new ShimmerVerObject(HW_ID.SHIMMER_GQ_802154_LR,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION);
private static final ShimmerVerObject svoShimmerGq802154Nr = new ShimmerVerObject(HW_ID.SHIMMER_GQ_802154_NR,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION);
private static final ShimmerVerObject svoShimmer2rGq = new ShimmerVerObject(HW_ID.SHIMMER_2R_GQ,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION);
/** The GQ 802.15.4 firmware on any hardware. The GQs above are matched on their hardware, but a
* Verisense in NeuroLynQ mode keeps its own hardware ID (61 to 68), so it is matched on the firmware it
* runs: nothing else runs GQ_802154. See ShimmerVerObject.isVerisenseNeuroLynQ(). */
private static final ShimmerVerObject svoVerisenseNeuroLynQ = new ShimmerVerObject(ShimmerVerDetails.ANY_VERSION,FW_ID.GQ_802154,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION,ShimmerVerDetails.ANY_VERSION);

private static final ShimmerVerObject svoExgSdLog = new ShimmerVerObject(HW_ID.SHIMMER_3,FW_ID.SDLOG,0,8,0,HW_ID_SR_CODES.EXP_BRD_EXG);
private static final ShimmerVerObject svoExgUnifiedSdLog = new ShimmerVerObject(HW_ID.SHIMMER_3,FW_ID.SDLOG,0,8,0,HW_ID_SR_CODES.EXP_BRD_EXG_UNIFIED);
Expand Down Expand Up @@ -1406,7 +1410,7 @@ public static class CompatibilityInfoForMaps{
public static final List<ShimmerVerObject> listOfCompatibleVersionInfoExgGeneral = Arrays.asList(
svoExgSdLog, svoExgBtStream, svoExgLogAndStream,
svoExgUnifiedSdLog, svoExgUnifiedBtStream, svoExgUnifiedLogAndStream,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoVerisenseNeuroLynQ,
svoShimmerECGmd, svoShimmer4Stock, svoStrokare, svoShimmer3RExgUnifiedLogAndStream);

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoExgEmg = Arrays.asList(
Expand All @@ -1418,22 +1422,22 @@ public static class CompatibilityInfoForMaps{
public static final List<ShimmerVerObject> listOfCompatibleVersionInfoExgEcg = Arrays.asList(
svoExgSdLog, svoExgBtStream, svoExgLogAndStream,
svoExgUnifiedSdLog, svoExgUnifiedBtStream, svoExgUnifiedLogAndStream,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoVerisenseNeuroLynQ,
svoShimmerECGmd, svoShimmer4Stock, svoShimmer3RExgUnifiedLogAndStream);

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoExgEcgGq = Arrays.asList(
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq);
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoVerisenseNeuroLynQ);

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoExgTest = Arrays.asList(
svoExgSdLog, svoExgBtStream, svoExgLogAndStream,
svoExgUnifiedSdLog, svoExgUnifiedBtStream, svoExgUnifiedLogAndStream,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoVerisenseNeuroLynQ,
svoShimmerECGmd, svoShimmer4Stock, svoShimmer3RExgUnifiedLogAndStream);

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoExgThreeUnipolar = Arrays.asList(
svoExgSdLog, svoExgBtStream, svoExgLogAndStream,
svoExgUnifiedSdLog, svoExgUnifiedBtStream, svoExgUnifiedLogAndStream,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoVerisenseNeuroLynQ,
svoShimmerECGmd, svoShimmer4Stock, svoShimmer3RExgUnifiedLogAndStream);

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoExgRespiration = Arrays.asList(
Expand All @@ -1446,7 +1450,7 @@ public static class CompatibilityInfoForMaps{

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoAnyExpBoardStandardFW = Arrays.asList(
svoAnyIntExpBoardAndSdlog,svoAnyIntExpBoardAndBtStream,svoAnyIntExpBoardAndLogAndStream,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoAnyIntExpBoardAndLogAndStream3R,
svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoVerisenseNeuroLynQ, svoAnyIntExpBoardAndLogAndStream3R,
svoShimmer4Stock, svoArduino, svoSweatch, svoStrokare);

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoBattVoltage = Arrays.asList(
Expand All @@ -1457,7 +1461,7 @@ public static class CompatibilityInfoForMaps{
public static final List<ShimmerVerObject> listOfCompatibleVersionInfoGsr = Arrays.asList(
svoGsrSdLog, svoGsrBtStream, svoGsrLogAndStream, svoGsrGqBle,
svoGsrUnifiedSdLog, svoGsrUnifiedBtStream, svoGsrUnifiedLogAndStream,
svoGsrUnifiedGqBle, svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq,
svoGsrUnifiedGqBle, svoShimmerGq802154Lr, svoShimmerGq802154Nr, svoShimmer2rGq, svoVerisenseNeuroLynQ,
svoShimmer4Stock, svoShimmer3RGsrUnifiedLogAndStream,svoShimmer3RGsrNewImuLogAndStream);

public static final List<ShimmerVerObject> listOfCompatibleVersionInfoBMP180 = Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,17 @@ public enum SPAN_VERSION{
UNKNOWN,
SPAN_SR1_3_1, // 115200 baud
SPAN_SR1_3_0, // 230400 baud
VIRTUAL;
VIRTUAL,
/** nRF52840 with native USB (verisense-firmware SR9_SPAN_NRF52840): one CDC port, no FTDI bridge and no BSL */
SPAN_NRF52840;

public boolean isSupported(){
return this==SPAN_VERSION.SPAN_SR1_3_1;
return this==SPAN_VERSION.SPAN_SR1_3_1 || this==SPAN_VERSION.SPAN_NRF52840;
}

/** Whether the Span is an MSP430 that is reset and programmed through the BSL on its FTDI's first port */
public boolean isMspBslSupported(){
return this==SPAN_VERSION.SPAN_SR1_3_0 || this==SPAN_VERSION.SPAN_SR1_3_1;
}
}

Expand Down Expand Up @@ -107,6 +114,15 @@ public static final class SH_SEARCH {
"SHIMMER SPAN SR1-3.1",
};

/** USB product string of the nRF52840 Span (verisense-firmware
* SR9_SPAN_NRF52840/pca10056/blank/config/app_config.h). It is matched with
* {@link SERIAL_PORT#NORDIC_VEND_ID} and any PID: its PID, 0x5210, is
* provisional and unallocated under Nordic's VID, and matching on it would need a
* host release whenever it changes. See {@link HwDriverShimmerDeviceDetails#isSpanNrf52840}. */
public static final String[] SPAN_NRF52840 = new String[] {
"NeuroLynQ Span",
};

public static final String[] DISK_DRIVE = new String[] {
"Shimmer",
"Generic" // Some docks went out unprogrammed?
Expand Down Expand Up @@ -161,6 +177,14 @@ public static final class MASS_STORAGE_DEVICE {
"verisense",
};

/** A Verisense in NeuroLynQ mode says so in its USB product string, e.g.
* "Verisense-NeuroLynQ-01-2511210195BC" (verisense-firmware hal_usb_cdc.c,
* USB_PRODUCT_NAME_MODE_MARKER). It keeps the stock VID/PID, so this is the only
* way a host can tell it from a stock unit (DEV-1047). */
public static final String[] VERISENSE_NEUROLYNQ = new String[] {
"-NeuroLynQ-",
};

public static final String[] SHIMMER3R_DFU_DEVICE_BUS_DESCRITION = new String[] { "DFU in HS Mode" };

public static final class SERVICE_DESCRIPTION {
Expand Down Expand Up @@ -195,6 +219,9 @@ public static final class SERIAL_PORT {
public static final String FTDI_FT2232H_PROD_ID = "6010";
public static final String FTDI_FT4232H_PROD_ID = "6011";

/** Nordic Semiconductor: the vendor ID of the Verisense and of the nRF52840 Span */
public static final String NORDIC_VEND_ID = "1915";

public static final String VIRTUAL_PORT = "COM0COM";

public static final String[] SHIMMER_3R = new String[] {
Expand Down Expand Up @@ -321,6 +348,26 @@ else if(this.deviceType == DEVICE_TYPE.BASE6) {
}
}

/** Whether a USB device is an nRF52840 Span: Nordic's vendor ID with the Span's
* product string, whatever its product ID. Every platform's detection calls this so
* that they all apply the same rule.
* @param usbVendorId the vendor ID as four hex digits, e.g. "1915"
* @param usbProductString the USB product string (iProduct)
*/
public static boolean isSpanNrf52840(String usbVendorId, String usbProductString) {
return SH_SEARCH.SERIAL_PORT.NORDIC_VEND_ID.equalsIgnoreCase(usbVendorId)
&& usbProductString!=null
&& UtilShimmer.stringContainsItemFromListUpperCaseCheck(usbProductString, SH_SEARCH.SPAN_NRF52840);
}

/** Whether a Verisense is in NeuroLynQ mode, from its USB product string (iProduct).
* A NeuroLynQ-mode Verisense serves the ShimmerGQ $ dock protocol and not its native
* one, so the two need different drivers. */
public static boolean isVerisenseNeuroLynQ(String usbProductString) {
return usbProductString!=null
&& UtilShimmer.stringContainsItemFromListUpperCaseCheck(usbProductString, SH_SEARCH.VERISENSE_NEUROLYNQ);
}

public static DEVICE_TYPE getDeviceTypeFromLabel(String label){
for (DEVICE_TYPE deviceType:DEVICE_TYPE.values()) {
if(deviceType.getLabel().equals(label)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ private void parseShimmerVerDetails() {
|| (mHardwareVersion==HW_ID.SHIMMER_GQ_BLE && mFirmwareIdentifier==FW_ID.GQ_BLE)
|| ((mHardwareVersion==HW_ID.SHIMMER_GQ_802154_NR || mHardwareVersion==HW_ID.SHIMMER_GQ_802154_LR) && mFirmwareIdentifier==FW_ID.GQ_802154)
|| (mHardwareVersion==HW_ID.SHIMMER_2R_GQ && mFirmwareIdentifier==FW_ID.GQ_802154)
|| isVerisenseNeuroLynQ()
|| mHardwareVersion==HW_ID.SPAN
|| mHardwareVersion==HW_ID.SHIMMER_4_SDK
|| mHardwareVersion==HW_ID.SWEATCH
Expand Down Expand Up @@ -410,6 +411,7 @@ public static boolean isSupportedRtcConfigViaUart(int hwVer, int fwId) {
|| (hwVer==HW_ID.SHIMMER_GQ_802154_NR)
|| (hwVer==HW_ID.SHIMMER_GQ_802154_LR)
|| (hwVer==HW_ID.SHIMMER_2R_GQ)
|| isVerisenseNeuroLynQ(hwVer, fwId)
|| (hwVer==HW_ID.SHIMMER_4_SDK)
|| (hwVer==HW_ID.SHIMMER_3R)){
return true;
Expand All @@ -427,6 +429,7 @@ public static boolean isSupportedConfigViaUart(int hwVer, int fwId) {
|| hwVer==HW_ID.SHIMMER_GQ_802154_NR
|| hwVer==HW_ID.SHIMMER_GQ_802154_LR
|| hwVer==HW_ID.SHIMMER_2R_GQ
|| isVerisenseNeuroLynQ(hwVer, fwId)
|| hwVer==HW_ID.SHIMMER_4_SDK){
return true;
}
Expand All @@ -445,7 +448,8 @@ public static boolean isSupportedSdCardAccess(int hwVer, int fwId) {
|| (hwVer==HW_ID.SHIMMER_GQ_BLE && fwId == FW_ID.GQ_BLE)
// || hwVer==HW_ID.SHIMMER_GQ_802154_NR
// || hwVer==HW_ID.SHIMMER_GQ_802154_LR
|| fwId==ShimmerVerDetails.FW_ID.GQ_802154
// A NeuroLynQ-mode Verisense runs the GQ's firmware but has no SD card
|| (fwId==ShimmerVerDetails.FW_ID.GQ_802154 && !isVerisenseNeuroLynQ(hwVer, fwId))
|| hwVer==HW_ID.SHIMMER_2R_GQ
|| (hwVer==HW_ID.SHIMMER_4_SDK && fwId == FW_ID.SHIMMER4_SDK_STOCK)
){
Expand Down Expand Up @@ -645,13 +649,26 @@ public boolean isShimmerGenGq(int hwVer) {
* @return
*/
public boolean isShimmerGenGq(int hwVer, int fwId) {
if(isShimmerGenGq(hwVer)){
if(isShimmerGenGq(hwVer) || isVerisenseNeuroLynQ(hwVer, fwId)){
// if(((hwVer==HW_ID.SHIMMER_GQ_802154_LR) || (hwVer==HW_ID.SHIMMER_GQ_802154_NR) || (hwVer==HW_ID.SHIMMER_2R_GQ))
// && (fwId==FW_ID.GQ_802154 || fwId==FW_ID.GQ_BLE)){
return true;
}
return false;
}

/**
* A Verisense in NeuroLynQ mode (verisense-firmware ASM_NeuroLynQ): Verisense
* hardware running the GQ 802.15.4 firmware. It reports its own hardware ID, but it
* answers and streams as a GQ does, so to the host it is a GQ (DEV-1047).
*/
public boolean isVerisenseNeuroLynQ() {
return isVerisenseNeuroLynQ(getHardwareVersion(), getFirmwareIdentifier());
}

public static boolean isVerisenseNeuroLynQ(int hwVer, int fwId) {
return isShimmerGenVerisense(hwVer) && fwId==FW_ID.GQ_802154;
}

public boolean isShimmerVideoDevice(){
return isShimmerVideoDevice(getHardwareVersion());
Expand All @@ -667,8 +684,10 @@ public static boolean isShimmerVideoDevice(int hardwareVersion) {
return false;
}

/** Verisense hardware running its own firmware. In NeuroLynQ mode it runs the GQ's
* firmware and sends GQ data instead, see {@link #isVerisenseNeuroLynQ()}. */
public boolean isShimmerGenVerisense() {
return isShimmerGenVerisense(getHardwareVersion());
return isShimmerGenVerisense(getHardwareVersion()) && !isVerisenseNeuroLynQ();
}

public static boolean isShimmerGenVerisense(int hwVer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.shimmerresearch.driverUtilities;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import com.shimmerresearch.driverUtilities.HwDriverShimmerDeviceDetails.SPAN_VERSION;

/**
* How the host recognises the nRF52840 Span, and what it assumes about one once found
* (DEV-1047).
* <p>
* The Span is matched on Nordic's vendor ID and its USB product string, not on its
* PID: 0x5210 is provisional and unallocated, and a PID match would need a host release
* whenever it changes. The strings below are the ones Windows reported for the bench
* devices on 2026-09-24.
*/
public class API_00012_SpanNrf52840IdentityTest {

/** iProduct of the nRF52840 Span, verisense-firmware SR9_SPAN_NRF52840 */
private static final String SPAN_NRF52840_PRODUCT = "NeuroLynQ Span";
/** A Verisense in NeuroLynQ mode, on the same VID. It is a node, not a Span. */
private static final String VERISENSE_NEUROLYNQ_PRODUCT = "Verisense-NeuroLynQ-01-2511210195BC";
private static final String VERISENSE_PRODUCT = "Verisense-01-2511210195BC";
private static final String SR9_SPAN_PRODUCT = "SHIMMER SPAN SR1-3.1";

@Test
public void matchesNordicVendorAndSpanProductString() {
assertTrue(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", SPAN_NRF52840_PRODUCT));
}

@Test
public void productStringMatchIgnoresCase() {
assertTrue(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", SPAN_NRF52840_PRODUCT.toUpperCase()));
}

@Test
public void rejectsTheProductStringUnderAnotherVendor() {
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840(
HwDriverShimmerDeviceDetails.SH_SEARCH.SERIAL_PORT.FTDI_VEND_ID, SPAN_NRF52840_PRODUCT));
}

@Test
public void rejectsOtherNordicDevices() {
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", VERISENSE_NEUROLYNQ_PRODUCT));
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", VERISENSE_PRODUCT));
}

@Test
public void rejectsTheSr9() {
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840(
HwDriverShimmerDeviceDetails.SH_SEARCH.SERIAL_PORT.FTDI_VEND_ID, SR9_SPAN_PRODUCT));
}

@Test
public void rejectsMissingValues() {
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840(null, SPAN_NRF52840_PRODUCT));
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", null));
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("", ""));
}

@Test
public void nrf52840SpanIsSupportedButHasNoBsl() {
assertTrue(SPAN_VERSION.SPAN_NRF52840.isSupported());
assertFalse(SPAN_VERSION.SPAN_NRF52840.isMspBslSupported());
}

@Test
public void msp430SpansKeepTheirBsl() {
assertTrue(SPAN_VERSION.SPAN_SR1_3_1.isSupported());
assertTrue(SPAN_VERSION.SPAN_SR1_3_1.isMspBslSupported());
assertFalse(SPAN_VERSION.SPAN_SR1_3_0.isSupported());
assertTrue(SPAN_VERSION.SPAN_SR1_3_0.isMspBslSupported());
assertFalse(SPAN_VERSION.VIRTUAL.isMspBslSupported());
assertFalse(SPAN_VERSION.UNKNOWN.isMspBslSupported());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.shimmerresearch.driverUtilities;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

/**
* How the host tells a NeuroLynQ-mode Verisense from a stock one (DEV-1047).
* <p>
* Both enumerate as 1915:520F. The NeuroLynQ firmware adds "-NeuroLynQ" after the name
* prefix in its USB product string, whichever prefix it has, and nothing else changes.
* The first string is the bench node's on 2026-09-24.
*/
public class API_00013_VerisenseNeuroLynQMarkerTest {

@Test
public void recognisesTheNeuroLynQMarker() {
assertTrue(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ("Verisense-NeuroLynQ-01-2511210195BC"));
}

/** Without a passkey ID, and with the factory string an unprovisioned unit reports */
@Test
public void recognisesItWithoutAPasskeyOrAProductionConfig() {
assertTrue(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ("Verisense-NeuroLynQ-2511210195BC"));
assertTrue(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ("Verisense-NeuroLynQ-FFFFFFFF95BC"));
}

/** The marker follows whatever name prefix the production config carries */
@Test
public void recognisesItAfterAProvisionedPrefix() {
assertTrue(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ("Acme-NeuroLynQ-01-2511210195BC"));
}

@Test
public void aStockVerisenseIsNotNeuroLynQ() {
assertFalse(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ("Verisense-01-2511210195BC"));
assertFalse(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ("Verisense-FFFFFFFF95BC"));
}

/** The nRF52840 Span says NeuroLynQ too, but it is a Span, not a node */
@Test
public void theSpanIsNotANode() {
assertFalse(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ("NeuroLynQ Span"));
}

@Test
public void noProductStringIsNotNeuroLynQ() {
assertFalse(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ(null));
assertFalse(HwDriverShimmerDeviceDetails.isVerisenseNeuroLynQ(""));
}
}
Loading
Loading