예제 #1
1
        /// <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;
        }
예제 #2
0
        /// <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;
        }
예제 #3
0
 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];
 }
예제 #4
0
 public RecordTable(RecordTableReader parent)
 {
     this.parent = parent;
 }
예제 #5
0
 public RecordTable(RecordTableReader parent)
 {
     this.parent = parent;
 }