1 /*
2  * Copyright 2017 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 #pragma once
17 
18 #include "mca_api.h"
19 
20 namespace SYSTEM_BT_TOOLS_MCAP_TOOL {
21 
22 class McapMdep {
23  public:
24   /**
25    * A control abstraction for a MCAP Data End Point (MDEP)
26    * @param mcap_test_interface Underlining MCAP interface to Bluetooth stack
27    * @param mcap_handle Parent MCAP application handle
28    * @param type 0 for Echo, 1 for Normal, nothing else
29    * @param max_mdl Maximum number of MDL's allowed
30    * @param data_callback Data channel callback function
31    */
32   McapMdep(btmcap_test_interface_t* mcap_test_interface,
33            tMCA_HANDLE mcap_handle, uint8_t type, uint8_t max_mdl,
34            tMCA_DATA_CBACK* data_callback);
35   /**
36    * Actually create the MDEP in the stack
37    * @return True if success
38    */
39   bool Create();
40   /**
41    * Destroy the MDEP in the stack
42    * @return True if success
43    */
44   bool Delete();
45   // Simple methods that are self-explanatory
46   tMCA_DEP GetHandle() const;
47   bool IsRegistered();
48 
49  private:
50   // Initialized during start up
51   btmcap_test_interface_t* _mcap_test_interface;
52   tMCA_HANDLE _mcap_handle;
53   tMCA_CS _mca_cs;
54 
55   // Initialized later
56   tMCA_DEP _mdep_handle = 0;
57 };
58 
59 }  // namespace SYSTEM_BT_TOOLS_MCAP_TOOL
60