diff --git a/Src/orbtraceIf.c b/Src/orbtraceIf.c index 70322b3d..f01dd3d6 100644 --- a/Src/orbtraceIf.c +++ b/Src/orbtraceIf.c @@ -22,9 +22,6 @@ static const struct OrbtraceInterfaceType _validDevices[DEVICE_NUM_DEVICES] = { 0, 0 } }; -#define LAST_NONOTAG_ORBTRACE "v1.3.1-0" -#define SPECIAL_MATCH "v1.3.2-0" - /* BMP iInterface string */ #define BMP_IFACE "Black Magic Trace Capture" @@ -49,6 +46,11 @@ static const struct OrbtraceInterfaceType _validDevices[DEVICE_NUM_DEVICES] = /* Maximum descriptor length from USB specification */ #define MAX_USB_DESC_LEN (256) +/* ORBTrace protocol versions */ +#define PROT_UNKNOWN (0x00) +#define PROT_TPIU (0x01) +#define PROT_OTAGV1_0 (0x10) + /* String on front of version number to remove */ #define VERSION_FRONTMATTER "Version: " static const struct @@ -548,7 +550,9 @@ bool OrbtraceGetIfandEP( struct OrbtraceIf *o ) if ( i->bInterfaceClass != 0xff || i->bInterfaceSubClass != 0x54 || - ( i->bInterfaceProtocol != 0x00 && i->bInterfaceProtocol != 0x01 ) || + ( i->bInterfaceProtocol != PROT_UNKNOWN && + i->bInterfaceProtocol != PROT_TPIU && + i->bInterfaceProtocol != PROT_OTAGV1_0 ) || i->bNumEndpoints != 0x01 ) { /* Not the interface we're looking for */ @@ -560,6 +564,7 @@ bool OrbtraceGetIfandEP( struct OrbtraceIf *o ) altsetting = i->bAlternateSetting; num_altsetting = config->interface[if_num].num_altsetting; + o->supportsOTAG = ( i->bInterfaceProtocol == PROT_OTAGV1_0 ); genericsReport( V_DEBUG, "Found interface %#x with altsetting %#x and ep %#x" EOL, o->iface, altsetting, o->ep ); interface_found = true; @@ -575,10 +580,6 @@ bool OrbtraceGetIfandEP( struct OrbtraceIf *o ) } o->isOrbtrace = true; - /* This is ick and will be changed soon */ - o->supportsOTAG = ( ( strncmp( LAST_NONOTAG_ORBTRACE, o->devices[o->activeDevice].version, strlen( LAST_NONOTAG_ORBTRACE ) ) < 0 ) - && strncmp ( SPECIAL_MATCH, o->devices[o->activeDevice].version, strlen( SPECIAL_MATCH ) ) ); - break; }