Specifying Device Driver Identification Information
Two of the virtual functions you must implement return identification information about the device driver used to communicate with your device. This information can be useful for debugging purposes.
getDriverDescription()
— Returns a character vector that identifies the device.getDriverVersion()
— Returns a character vector that specifies the version of the device driver.
Adaptors typically use an SDK function to query the device to get this information, if the SDK supports it, or obtain the information from the device documentation.
User Scenario
The identification character vectors returned by
getDriverDescription()
and
getDriverVersion()
are visible to users if they call
imaqhwinfo
, specifying a video input object as an argument,
as follows.
vid = videoinput('mydeviceimaq'); imaqhwinfo(vid) ans = AdaptorName: 'mydeviceimaq' DeviceName: 'MyDevice' MaxHeight: 280 MaxWidth: 120 TotalSources: 1 VendorDriverDescription: 'MyDevice_Driver' VendorDriverVersion: '1.0.0'
Example
The following example contains skeletal implementations of the
getDriverDescription()
and
getDriverVersion()
functions.
const char* MyDeviceAdaptor::getDriverDescription() const{ return "MyDevice_Driver"; } const char* MyDeviceAdaptor::getDriverVersion() const { return "1.0.0"; }