File: XnClientUSBControlEndpoint.h

package info (click to toggle)
openni2 2.2.0.33%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 22,216 kB
  • sloc: cpp: 111,197; ansic: 35,511; sh: 10,542; python: 1,313; java: 952; makefile: 575; xml: 12
file content (45 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __XNUSBCONTROLENDPOINT_H__
#define __XNUSBCONTROLENDPOINT_H__

#include "ISyncIOConnection.h"

struct XnUSBDeviceHandle;
typedef XnUSBDeviceHandle*  XN_USB_DEV_HANDLE;

namespace xn
{

class ClientUSBControlEndpoint : virtual public ISyncIOConnection
{
public:
	ClientUSBControlEndpoint(XnUInt32 nPreControlReceiveSleep);
	virtual ~ClientUSBControlEndpoint();
	// Operations
	XnStatus Init(XN_USB_DEV_HANDLE hUSBDevice);
	void Shutdown();


	// ISyncIOConnection implementation
	virtual XnStatus Connect();
	virtual void Disconnect();
	virtual XnBool IsConnected() const;
	virtual XnUInt16 GetMaxPacketSize() const;
	
	//nSize is max size on input, actual size on output
	virtual XnStatus Receive(void* pData, XnUInt32& nSize);
	virtual XnStatus Send(const void* pData, XnUInt32 nSize);

private:
	//Low level usb packet size - not to be confused with our "logical" packet size which is bigger
	static const XnUInt32 USB_LOW_LEVEL_MAX_PACKET_SIZE; 
	
	static const XnUInt32 SEND_TIMEOUT;
	static const XnUInt32 RECEIVE_TIMEOUT;

	XN_USB_DEV_HANDLE m_hUSBDevice;
	XnUInt32 m_nPreControlReceiveSleep;
};

}

#endif // __XNUSBCONTROLENDPOINT_H__