From 9fd53d3b6d720439de8fe82edc9dd56bc8255bae Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Sun, 15 May 2022 20:38:00 -0700 Subject: [PATCH] Adding WifiClientHistory. --- src/WifiClientCache.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/WifiClientCache.cpp b/src/WifiClientCache.cpp index 1754a45..ac686ac 100644 --- a/src/WifiClientCache.cpp +++ b/src/WifiClientCache.cpp @@ -82,7 +82,7 @@ namespace OpenWifi { void WifiClientCache::ReturnNumbers(const std::string &S, uint HowMany, const std::vector &SNArr, std::vector &A, bool ReverseResult) { std::lock_guard G(Mutex_); - if (S.length() == 12) { + if (S.length() == 12) { uint64_t SN = std::stoull(S, nullptr, 16); auto It = std::find(SNArr.begin(), SNArr.end(), SN); if (It != SNArr.end()) { @@ -116,8 +116,15 @@ namespace OpenWifi { } void WifiClientCache::FindNumbers(const std::string &S, uint HowMany, std::vector &A) { - if(S.empty()) - return; + A.clear(); + if(S.empty()) { + auto Start = SNs_.begin(); + while(HowMany && Start!=SNs_.end()) { + A.push_back(*Start++); + HowMany--; + } + return; + } if (S[0] == '*') { std::string Reversed;