/// <summary> /// Class constructor for the traq|paq /// </summary> public TraqpaqDevice() { // find the device traqpaqDeviceFinder = new UsbDeviceFinder(Constants.VID, Constants.PID); // open the device this.MyUSBDevice = UsbDevice.OpenUsbDevice(traqpaqDeviceFinder); // If the device is open and ready if (MyUSBDevice == null) throw new TraqPaqNotConnectedException("Device not found"); this.reader = MyUSBDevice.OpenEndpointReader(ReadEndpointID.Ep01); this.writer = MyUSBDevice.OpenEndpointWriter(WriteEndpointID.Ep02); // create the battery object this.battery = new Battery(this); // get a list of saved tracks getAllTracks(); // get the record table data tableReader = new RecordTableReader(this); tableReader.readRecordTable(); this.recordTableList = tableReader.recordTable; }
/// <summary> /// Class constructor for the traq|paq /// </summary> public TraqpaqDevice() { // find the device traqpaqDeviceFinder = new UsbDeviceFinder(Constants.VID, Constants.PID); // open the device this.MyUSBDevice = UsbDevice.OpenUsbDevice(traqpaqDeviceFinder); // If the device is open and ready if (MyUSBDevice == null) { throw new TraqPaqNotConnectedException("Device not found"); } this.reader = MyUSBDevice.OpenEndpointReader(ReadEndpointID.Ep01); this.writer = MyUSBDevice.OpenEndpointWriter(WriteEndpointID.Ep02); // create the battery object this.battery = new Battery(this); // create the otp reader object this.myOTPreader = new OTPreader(this); // create a saved track reader to get a list of saved tracks this.trackReader = new SavedTrackReader(this); this.trackList = trackReader.trackList; // get the record table data tableReader = new RecordTableReader(this); tableReader.readRecordTable(); this.recordTableList = tableReader.recordTable; }
public RecordDataReader(TraqpaqDevice parent, RecordTableReader.RecordTable recordTable) { this.traqpaq = parent; this.recordTable = recordTable; // allocate the recordData array, 256 bytes per page this.numPages = (recordTable.EndAddress - recordTable.StartAddress) / Constants.MEMORY_PAGE_SIZE; this.recordDataPages = new RecordDataPage[numPages]; }
public RecordTable(RecordTableReader parent) { this.parent = parent; }