diff options
author | Andrew Duggan <aduggan@synaptics.com> | 2014-08-13 14:42:37 -0700 |
---|---|---|
committer | Andrew Duggan <aduggan@synaptics.com> | 2014-08-13 14:42:37 -0700 |
commit | c14ec9ced73a2f5d243c010c9fc45cb5e4956a3a (patch) | |
tree | 1c9963312ec025bf58e9bc8eb93e6db11f420cd7 | |
parent | 9b590b7559bb17860e5e83fe703a7e995213c63f (diff) | |
download | platform_external_rmi4utils-c14ec9ced73a2f5d243c010c9fc45cb5e4956a3a.tar.gz platform_external_rmi4utils-c14ec9ced73a2f5d243c010c9fc45cb5e4956a3a.tar.bz2 platform_external_rmi4utils-c14ec9ced73a2f5d243c010c9fc45cb5e4956a3a.zip |
Stop scanning the PDT if we find an specific function when ScanPDT's endFunc parameter is set
-rw-r--r-- | rmi4update/main.cpp | 2 | ||||
-rw-r--r-- | rmidevice/rmidevice.cpp | 5 | ||||
-rw-r--r-- | rmidevice/rmidevice.h | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/rmi4update/main.cpp b/rmi4update/main.cpp index 2c15dc5..764acc7 100644 --- a/rmi4update/main.cpp +++ b/rmi4update/main.cpp @@ -176,7 +176,7 @@ int GetFirmwareProps(const char * deviceFile, std::string &props) if (rc) return rc; - rmidevice.ScanPDT(); + rmidevice.ScanPDT(0x1); rmidevice.QueryBasicProperties(); ss << rmidevice.GetFirmwareVersionMajor() << "." diff --git a/rmidevice/rmidevice.cpp b/rmidevice/rmidevice.cpp index 0b85b55..8e0b25e 100644 --- a/rmidevice/rmidevice.cpp +++ b/rmidevice/rmidevice.cpp @@ -253,7 +253,7 @@ void RMIDevice::PrintFunctions() funcIter->GetQueryBase()); } -int RMIDevice::ScanPDT() +int RMIDevice::ScanPDT(int endFunc) { int rc; unsigned int page; @@ -283,6 +283,9 @@ int RMIDevice::ScanPDT() m_functionList.push_back(func); found = true; + + if (func.GetFunctionNumber() == endFunc) + return 0; } if (!found) diff --git a/rmidevice/rmidevice.h b/rmidevice/rmidevice.h index 6271c1e..5bae8ba 100644 --- a/rmidevice/rmidevice.h +++ b/rmidevice/rmidevice.h @@ -50,7 +50,7 @@ public: int SetRMIPage(unsigned char page); - int ScanPDT(); + int ScanPDT(int endFunc = 0); void PrintProperties(); int Reset(); |