class io.HidDevice

class HidDevice {
    // fields

    io.HidDeviceEvents readonly volatile m_activeEvents;
    std.Error const* readonly volatile m_ioError;
    bool readonly m_isOpen;

    // properties

    size_t autoget property m_readBlockSize;
    size_t autoget property m_readBufferSize;
    uint_t autoget property m_readTimeout;
    io.HidDeviceOptions autoget property m_options;
    io.HidDeviceDesc* const property m_deviceDesc;

    // construction

    construct();
    destruct();

    // methods

    bool errorcode open(string_t path);

    bool errorcode open(
        uint16_t vid,
        uint16_t pid,
        string_t serialNumber = null
    );

    void close();

    size_t errorcode getReportDescriptor(
        void* p,
        size_t size
    );

    size_t errorcode getInputReport(
        void* p,
        size_t size
    );

    size_t errorcode getFeatureReport(
        void* p,
        size_t size
    );

    size_t errorcode sendFeatureReport(
        void* p,
        size_t size
    );

    size_t errorcode read(
        void* p,
        size_t size
    );

    size_t errorcode write(
        void const* p,
        size_t size
    );

    long errorcode wait(
        io.HidDeviceEvents eventMask,
        void function* handler(io.HidDeviceEvents triggeredEvents)
    );

    bool errorcode cancelWait(long handle);

    io.HidDeviceEvents blockingWait(
        io.HidDeviceEvents eventMask,
        uint_t timeout = -1
    );

    io.HidDeviceEvents async asyncWait(io.HidDeviceEvents eventMask);

    // aliases

    alias dispose = close;
};