Files
MuditaOS/module-bluetooth/Bluetooth/interface/BluetoothDriver.hpp
Lefucjusz 6ed82f3fa3 [MOS-1005] Fix handsfree ringing after caller hangs up
* Fix of the issue that incoming call triggered
handsfree ringing which didn't stop after
calling side hung up.
* Cleanup of several places in code, minor
bluetooth <-> cellular integration refactor.
2023-07-17 15:16:29 +02:00

33 lines
1.3 KiB
C++

// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <functional>
#include "Device.hpp"
#include "Result.hpp"
namespace bluetooth
{
using PowerOnCallback = std::function<void()>;
class AbstractDriver
{
public:
virtual ~AbstractDriver() noexcept = default;
using ErrorCallback = std::function<void(uint8_t)>;
[[nodiscard]] virtual auto init() -> Result::Code = 0;
[[nodiscard]] virtual auto run() -> Result::Code = 0;
[[nodiscard]] virtual auto stop() -> Result::Code = 0;
[[nodiscard]] virtual auto scan() -> Result = 0;
virtual void stopScan() = 0;
virtual void setVisibility(bool visibility) = 0;
virtual void pair(Devicei device, std::uint8_t protectionLevel = 0) = 0;
virtual void unpair(Devicei device) = 0;
virtual void registerErrorCallback(const ErrorCallback &newCallback) = 0;
virtual void registerPowerOnCallback(const PowerOnCallback &newCallback) = 0;
};
} // namespace bluetooth