mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-05-23 16:14:59 -04:00
ssp seems working minor crash fixups copy lacks patched obsolete code removed Devicei tests added for added code and cleanup Added missing tests for new functions Code cleaned up a bit - mostly moved to cpp
31 lines
877 B
C++
31 lines
877 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
#include <Bluetooth/Device.hpp>
|
|
#include <list>
|
|
#include <vector>
|
|
#include <functional>
|
|
|
|
namespace bluetooth::gap
|
|
{
|
|
/// class to store and get devices in GAP operations
|
|
class Devices
|
|
{
|
|
std::list<Devicei> devices;
|
|
|
|
public:
|
|
using iter = decltype(devices)::iterator;
|
|
iter find(bd_addr_t &addr);
|
|
iter find(DEVICE_STATE st);
|
|
void for_each(const std::function<void(Devicei &)> &f);
|
|
iter end();
|
|
// adds element, if element already on list - remove and add anew
|
|
iter put(Devicei &&dev);
|
|
// same as above
|
|
iter put(bd_addr_t &addr);
|
|
void clear();
|
|
auto getList() -> std::vector<Devicei>;
|
|
};
|
|
} // namespace bluetooth::gap
|