Started work on database handling.
This commit is contained in:
48
include/ehs/io/UsbBase.h
Normal file
48
include/ehs/io/UsbBase.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include "ehs/Types.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class UsbBase
|
||||
{
|
||||
private:
|
||||
UInt_32 bus;
|
||||
UInt_32 address;
|
||||
|
||||
public:
|
||||
virtual ~UsbBase() = default;
|
||||
|
||||
UsbBase();
|
||||
|
||||
UsbBase(UInt_32 bus, UInt_32 address);
|
||||
|
||||
UsbBase(UsbBase&& usb) noexcept;
|
||||
|
||||
UsbBase(const UsbBase& usb);
|
||||
|
||||
UsbBase& operator=(UsbBase&& usb) noexcept;
|
||||
|
||||
UsbBase& operator=(const UsbBase& usb);
|
||||
|
||||
virtual void Initialize() = 0;
|
||||
|
||||
virtual void Release() = 0;
|
||||
|
||||
virtual bool IsInitialized() const = 0;
|
||||
|
||||
virtual Size Send(const Byte* data, Size size) = 0;
|
||||
|
||||
void BulkSend(const Byte* data, Size size);
|
||||
|
||||
virtual Size Receive(Byte* data, Size size) = 0;
|
||||
|
||||
void BulkReceive(Byte** data, Size* size);
|
||||
|
||||
UInt_32 GetBus() const;
|
||||
|
||||
UInt_32 GetAddress() const;
|
||||
|
||||
bool IsValid() const;
|
||||
};
|
||||
}
|
34
include/ehs/io/Usb_LNX.h
Normal file
34
include/ehs/io/Usb_LNX.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "UsbBase.h"
|
||||
#include "File.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Usb final : public UsbBase
|
||||
{
|
||||
private:
|
||||
int hdl;
|
||||
|
||||
public:
|
||||
~Usb() override;
|
||||
|
||||
Usb();
|
||||
|
||||
Usb(UInt_32 bus, UInt_32 address);
|
||||
|
||||
Usb(Usb&& usb) noexcept;
|
||||
|
||||
Usb(const Usb& usb);
|
||||
|
||||
Usb& operator=(Usb&& usb) noexcept;
|
||||
|
||||
Usb& operator=(const Usb& usb);
|
||||
|
||||
void Initialize() override;
|
||||
|
||||
void Release() override;
|
||||
|
||||
bool IsInitialized() const override;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user