bool SrmDevices::exclusivePort( CommPortPtr dev ) { switch( protoVersion ){ case 5: if( dev->type() == "Serial" && dev->name().contains( "PL2303" ) ) return true; break; case 6: case 7: if( dev->type() == "D2XX" && dev->name().startsWith( "POWERCONTROL" ) ) return true; break; } return false; }
bool SrmDevices::supportsPort( CommPortPtr dev ) { #if defined(SRMIO_HAVE_TERMIOS) || defined(SRMIO_HAVE_WINCOM) // we could check device name starts with "com" or "/dev" // but we wouldn't have got here unless it was a supported // serial port anyway. if( dev->type() == "Serial" ) return true; #endif #ifdef SRMIO_HAVE_D2XX if( dev->type() == "D2XX" ){ switch( protoVersion ){ case 6: case 7: return true; } } #endif return false; }