aboutsummaryrefslogtreecommitdiff
path: root/rmidevice/rmidevice.h
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2014-04-07 10:44:40 -0700
committerAndrew Duggan <aduggan@synaptics.com>2014-04-07 10:44:40 -0700
commit5d47750894ddaf019a016505f790c439e2eae3ac (patch)
tree3264ee4bddb24c9f8106c90799d6c6d5bdfe55e6 /rmidevice/rmidevice.h
parent65e5553ace01906e5c0ac3a810afd552a2820acd (diff)
downloadrmi4utils-5d47750894ddaf019a016505f790c439e2eae3ac.tar.gz
Move some functions from HIDDevice to RMIDevice to better support multiple transports update the Android builds.
Diffstat (limited to 'rmidevice/rmidevice.h')
-rw-r--r--rmidevice/rmidevice.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/rmidevice/rmidevice.h b/rmidevice/rmidevice.h
index de17212..cc1f7ca 100644
--- a/rmidevice/rmidevice.h
+++ b/rmidevice/rmidevice.h
@@ -11,19 +11,23 @@
class RMIDevice
{
public:
- RMIDevice(int bytesPerReadRequest = 0) : m_bytesPerReadRequest(bytesPerReadRequest)
+ RMIDevice(int bytesPerReadRequest = 0) : m_bCancel(false),
+ m_bytesPerReadRequest(bytesPerReadRequest), m_page(-1)
{}
virtual int Open(const char * filename) = 0;
virtual int Read(unsigned short addr, unsigned char *data,
unsigned short len) = 0;
virtual int Write(unsigned short addr, const unsigned char *data,
unsigned short len) = 0;
- virtual int SetMode(int mode) = 0;
+ virtual int SetMode(int mode) { return -1; /* Unsupported */ }
virtual int WaitForAttention(struct timeval * timeout = NULL, int *sources = NULL) = 0;
+ virtual int GetAttentionReport(struct timeval * timeout, int *sources, unsigned char *buf,
+ int *len)
+ { return -1; /* Unsupported */ }
virtual void Close() = 0;
- virtual void Cancel() = 0;
+ virtual void Cancel() { m_bCancel = true; }
- virtual unsigned long GetFirmwareID() { return m_buildID; }
+ unsigned long GetFirmwareID() { return m_buildID; }
virtual int QueryBasicProperties();
int SetRMIPage(unsigned char page);
@@ -51,6 +55,7 @@ protected:
unsigned short m_packageRev;
unsigned long m_buildID;
unsigned char m_sensorID;
+ unsigned long m_boardID;
bool m_hasDS4Queries;
bool m_hasMultiPhysical;
@@ -60,9 +65,12 @@ protected:
bool m_hasPackageIDQuery;
bool m_hasBuildIDQuery;
+ bool m_bCancel;
int m_bytesPerReadRequest;
+ int m_page;
};
long long diff_time(struct timespec *start, struct timespec *end);
+int Sleep(int ms);
#endif /* _RMIDEVICE_H_ */ \ No newline at end of file