1 /*
2 * Copyright (C) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "classic_data_structure.h"
17
18 #include <string>
19 #include "classic_data_type_defs.h"
20
21 namespace bluetooth {
ClassicDataStructure()22 ClassicDataStructure::ClassicDataStructure()
23 {}
24
ClassicDataStructure(uint8_t dataLength,int type,const std::vector<uint8_t> & value)25 ClassicDataStructure::ClassicDataStructure(uint8_t dataLength, int type, const std::vector<uint8_t> &value)
26 : length_(dataLength), type_(type), data_(value)
27 {
28 }
29
~ClassicDataStructure()30 ClassicDataStructure::~ClassicDataStructure()
31 {
32 length_ = 0;
33 type_ = 0;
34 }
35
GetLength() const36 uint8_t ClassicDataStructure::GetLength() const
37 {
38 return length_;
39 }
40
GetDataValue() const41 std::vector<uint8_t> ClassicDataStructure::GetDataValue() const
42 {
43 return data_;
44 }
45
GetType() const46 int ClassicDataStructure::GetType() const
47 {
48 return type_;
49 }
50 } // namespace bluetooth