aboutsummaryrefslogtreecommitdiff
path: root/rmidevice/rmidevice.cpp
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2014-04-29 13:34:42 -0700
committerAndrew Duggan <aduggan@synaptics.com>2014-04-29 13:34:42 -0700
commite9a5cd0172ce96168a9431531d259b677f331aa6 (patch)
treeb210ba77d0deacecd5288d661de20e6c7efe51af /rmidevice/rmidevice.cpp
parentd02a0b030911951257e354fa82ce967bc4e51f9f (diff)
downloadrmi4utils-e9a5cd0172ce96168a9431531d259b677f331aa6.tar.gz
Add additional commands to rmihidtool and allow them to be set from the command line.
Diffstat (limited to 'rmidevice/rmidevice.cpp')
-rw-r--r--rmidevice/rmidevice.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/rmidevice/rmidevice.cpp b/rmidevice/rmidevice.cpp
index bdb9fc3..0d4fc19 100644
--- a/rmidevice/rmidevice.cpp
+++ b/rmidevice/rmidevice.cpp
@@ -237,6 +237,18 @@ bool RMIDevice::GetFunction(RMIFunction &func, int functionNumber)
return false;
}
+void RMIDevice::PrintFunctions()
+{
+ std::vector<RMIFunction>::iterator funcIter;
+
+ for (funcIter = m_functionList.begin(); funcIter != m_functionList.end(); ++funcIter)
+ fprintf(stdout, "0x%02x (%d) (%d): 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ funcIter->GetFunctionNumber(), funcIter->GetFunctionVersion(),
+ funcIter->GetInterruptSourceCount(), funcIter->GetDataBase(),
+ funcIter->GetControlBase(), funcIter->GetCommandBase(),
+ funcIter->GetQueryBase());
+}
+
int RMIDevice::ScanPDT()
{
int rc;
@@ -303,4 +315,14 @@ int Sleep(int ms)
}
}
return 0;
+}
+
+void print_buffer(const unsigned char *buf, unsigned int len)
+{
+ for (unsigned int i = 0; i < len; ++i) {
+ fprintf(stdout, "0x%02X ", buf[i]);
+ if (i % 8 == 7)
+ fprintf(stdout, "\n");
+ }
+ fprintf(stdout, "\n");
} \ No newline at end of file