mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-23 21:40:57 -05:00
To be able to proper propagate the pair message there was a need for Command wrapper (to be able to send command and parameter in one piece)
27 lines
1.1 KiB
C++
27 lines
1.1 KiB
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 <functional>
|
|
#include "Error.hpp"
|
|
|
|
namespace bluetooth
|
|
{
|
|
class AbstractDriver
|
|
{
|
|
public:
|
|
using ErrorCallback = std::function<void(uint8_t)>;
|
|
virtual ~AbstractDriver() noexcept = default;
|
|
|
|
[[nodiscard]] virtual auto init() -> Error::Code = 0;
|
|
[[nodiscard]] virtual auto run() -> Error::Code = 0;
|
|
[[nodiscard]] virtual auto stop() -> Error::Code = 0;
|
|
[[nodiscard]] virtual auto scan() -> Error = 0;
|
|
virtual void stopScan() = 0;
|
|
virtual void setVisibility(bool visibility) = 0;
|
|
[[nodiscard]] virtual auto pair(uint8_t *addr, std::uint8_t protectionLevel = 0) -> bool = 0;
|
|
virtual void registerErrorCallback(const ErrorCallback &newCallback) = 0;
|
|
};
|
|
} // namespace bluetooth
|