main
Line | |
---|
1 | /* CrO2 datassette emulator
|
---|
2 | * Copyright 2012, Adrien Destugues <pulkomandy@pulkomandy.ath.cx>
|
---|
3 | *
|
---|
4 | * Distributed under the terms of the MIT licence.
|
---|
5 | *
|
---|
6 | * Handles device communication through libusb
|
---|
7 | */
|
---|
8 |
|
---|
9 | #include <stdint.h>
|
---|
10 | #include <lusb0_usb.h>
|
---|
11 |
|
---|
12 | class Tape;
|
---|
13 |
|
---|
14 | class LibUSBDevice: public Device
|
---|
15 | {
|
---|
16 | public:
|
---|
17 | ~LibUSBDevice();
|
---|
18 |
|
---|
19 | int read(uint8_t* buffer, size_t max);
|
---|
20 | // Fill the buffer with data from device
|
---|
21 | int write(const uint8_t* buffer, size_t size, int blktype);
|
---|
22 | uint8_t getStatus();
|
---|
23 |
|
---|
24 | private:
|
---|
25 | LibUSBDevice() throw(const char*);
|
---|
26 | // Open device and set it up for communication
|
---|
27 | LibUSBDevice(const Device& other);
|
---|
28 |
|
---|
29 |
|
---|
30 | usb_dev_handle* handle;
|
---|
31 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.