www.gusucode.com > vnt工具箱matlab源码程序 > vnt/vnt/+can/+kvaser/VendorInfo.m
classdef (Hidden) VendorInfo < can.VendorInfo % VendorInfo Retrieve Kvaser specific CAN device information. % % This class contains information on Kvaser CAN devices. It also % contains child classes for each identified CAN device channel. % % See also VNT. % Authors: JDP % Copyright 2009-2010 The MathWorks, Inc. methods function obj = VendorInfo() % VendorInfo Construct an object containing information on Kvaser devices. % Set the name of the vendor. vendorName = 'Kvaser'; % Set the driver interface description. vendorDriverDescription = 'CANLib'; % Get the driver version information. vendorDriverVersion = can.kvaser.CANLib.canGetVersionEx(2); % Get the number of available device channels. channelCount = can.kvaser.CANLib.canGetNumberOfChannels(); % Initialize a ChannelInfo object as empty. channelInfo = can.kvaser.ChannelInfo.empty(); % Loop through the channel count and create channel information % objects for each. for index = 1:channelCount % Create a child class for this channel. Adjust the channel % index to be zero based. channelInfo(index) = can.kvaser.ChannelInfo(index - 1); end % Call the superclass constructor. obj@can.VendorInfo(... vendorName,... vendorDriverDescription,... vendorDriverVersion,... channelInfo); end end end