~aleteoryx/muditaos

ref: 52d5a35c1b9584612587fa62bf8e83c5c5a641fe muditaos/module-bluetooth/Bluetooth/interface/profiles/HSP/SCO.hpp -rw-r--r-- 911 bytes
52d5a35c — Bartosz Cichocki [EGD-6447] Add Bluetooth PIN pairing 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "Profile.hpp"
#include <memory>

extern "C"
{
#include <module-bluetooth/lib/btstack/src/bluetooth.h>
};
namespace bluetooth
{

    class SCO
    {
      public:
        SCO();
        ~SCO();

        SCO(const SCO &other) = delete;
        auto operator=(SCO rhs) -> SCO & = delete;
        SCO(SCO &&other) noexcept;
        auto operator=(SCO &&other) noexcept -> SCO &;

        void init();
        void send(hci_con_handle_t sco_handle);
        void receive(uint8_t *packet, uint16_t size);
        [[nodiscard]] auto getStreamData() const -> std::shared_ptr<BluetoothStreamData>;
        void setOwnerService(const sys::Service *service);

      private:
        class SCOImpl;
        std::unique_ptr<SCOImpl> pimpl;
    };
} // namespace Bt