13
0

Contourdesign: Implement USB probe/match

This commit is contained in:
Robin Gareus 2023-05-03 16:18:19 +02:00
parent a8f5f5636f
commit da9ed129e3
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 11 additions and 1 deletions

View File

@ -97,6 +97,15 @@ ContourDesignControlProtocol::available ()
return rv; return rv;
} }
bool
ContourDesignControlProtocol::match_usb (uint16_t vendor, uint16_t p)
{
if (vendor != ContourDesign) {
return false;
}
return (p == ShuttlePRO_id || p == ShuttlePRO_v2_id || p == ShuttleXpress_id);
}
int int
ContourDesignControlProtocol::set_active (bool yn) ContourDesignControlProtocol::set_active (bool yn)
{ {

View File

@ -85,6 +85,7 @@ public:
DeviceType device_type() const { return _device_type; } DeviceType device_type() const { return _device_type; }
static bool available (); static bool available ();
static bool match_usb (uint16_t, uint16_t);
int set_active (bool yn); int set_active (bool yn);

View File

@ -50,7 +50,7 @@ static ControlProtocolDescriptor contourdesign_descriptor = {
/* module */ 0, /* module */ 0,
/* available */ ContourDesignControlProtocol::available, /* available */ ContourDesignControlProtocol::available,
/* probe port */ 0, /* probe port */ 0,
/* match usb */ 0, /* match usb */ ContourDesignControlProtocol::match_usb,
/* initialize */ new_contourdesign_protocol, /* initialize */ new_contourdesign_protocol,
/* destroy */ delete_contourdesign_protocol, /* destroy */ delete_contourdesign_protocol,
}; };