source: thomson/elec/CrO2/software/device_bekit.h@ e017851

main
Last change on this file since e017851 was e017851, checked in by Adrien Destugues <pulkomandy@…>, 11 years ago

Port to Haiku. Untested.

git-svn-id: svn://localhost/thomson@28 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

  • Property mode set to 100644
File size: 839 bytes
Line 
1/* CrO2 datassette emulator
2 * Copyright 2013, Adrien Destugues <pulkomandy@pulkomandy.tk>
3 *
4 * Distributed under the terms of the MIT licence.
5 *
6 * Handles device communication through Haiku USB Kit
7 */
8
9#include "device.h"
10
11#include <stdint.h>
12#include <USBKit.h>
13
14class Tape;
15
16class HaikuDevice: public Device, BUSBRoster
17{
18 public:
19 ~HaikuDevice();
20
21 // Device
22 int read(uint8_t* buffer, size_t max);
23 // Fill the buffer with data from device
24 int write(const uint8_t* buffer, size_t size, int blktype);
25 uint8_t getStatus();
26
27 // BUSBRoster
28 status_t DeviceAdded(BUSBDevice* device);
29 void DeviceRemoved(BUSBDevice* device);
30 private:
31 HaikuDevice() throw(const char*);
32 // Open device and set it up for communication
33 HaikuDevice(const Device& other);
34
35 BUSBDevice* handle;
36
37 friend Device& Device::getDevice();
38};
Note: See TracBrowser for help on using the repository browser.