1 /*
2  * Copyright 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cstdint>
20 
21 #include "hci/hci_packets.h"
22 
23 namespace test_vendor_lib {
24 
25 class StreamParameters {
26  public:
27   uint8_t group_id;
28   uint8_t stream_id;
29   uint16_t max_sdu_m_to_s;
30   uint16_t max_sdu_s_to_m;
31   uint8_t rtn_m_to_s;
32   uint8_t rtn_s_to_m;
33   uint16_t handle;
34 };
35 
36 class ConnectedIsochronousStream {
37  public:
ConnectedIsochronousStream(StreamParameters & stream_param)38   ConnectedIsochronousStream(StreamParameters& stream_param)
39       : config_(stream_param) {}
40 
41   virtual ~ConnectedIsochronousStream() = default;
42 
IsConnected()43   bool IsConnected() const { return is_connected_; }
GetConfig()44   StreamParameters GetConfig() const { return config_; }
45 
GetHandle()46   uint16_t GetHandle() const { return config_.handle; }
Connect()47   void Connect() { is_connected_ = true; }
48 
Disconnect()49   void Disconnect() { is_connected_ = false; }
50 
51  private:
52   bool is_connected_{false};
53   StreamParameters config_;
54 };
55 }  // namespace test_vendor_lib
56