Skip to content

Commit

Permalink
Remove OtScanResponseIterator, Scan handling not yet implement. Need …
Browse files Browse the repository at this point in the history
…rework to not use vector
  • Loading branch information
jmartinez-silabs committed Feb 3, 2022
1 parent 1eecd6f commit 7eee826
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/platform/OpenThread/GenericNetworkCommissioningThreadDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,11 @@
#pragma once

#include <platform/NetworkCommissioning.h>
#include <vector>

namespace chip {
namespace DeviceLayer {
namespace NetworkCommissioning {

template <typename T>
class OtScanResponseIterator : public Iterator<T>
{
public:
OtScanResponseIterator(std::vector<T> * apScanResponse) : mpScanResponse(apScanResponse) {}
size_t Count() override { return mpScanResponse != nullptr ? mpScanResponse->size() : 0; }
bool Next(T & item) override
{
if (mpScanResponse == nullptr || currentIterating >= mpScanResponse->size())
{
return false;
}
item = (*mpScanResponse)[currentIterating];
currentIterating++;
return true;
}
void Release() override
{ /* nothing to do, we don't hold the ownership of the vector, and users is not expected to hold the ownership in OnFinished for
scan. */
}

private:
size_t currentIterating = 0;
// Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copiable.
std::vector<T> * mpScanResponse;
};

class GenericThreadDriver final : public ThreadDriver
{
public:
Expand Down

0 comments on commit 7eee826

Please sign in to comment.