• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef USB_INFO_H
17 #define USB_INFO_H
18 
19 #include <string>
20 #include <vector>
21 
22 namespace OHOS {
23 namespace USB {
24 struct USBDeviceInfo {
25     int32_t status;
26     int32_t busNum;
27     int32_t devNum;
28 };
29 
30 class UsbInfo {
31 public:
setDevInfoStatus(int32_t status)32     void setDevInfoStatus(int32_t status)
33     {
34         devInfo.status = status;
35     }
setDevInfoBusNum(int32_t busNum)36     void setDevInfoBusNum(int32_t busNum)
37     {
38         devInfo.busNum = busNum;
39     }
setDevInfoDevNum(int32_t devNum)40     void setDevInfoDevNum(int32_t devNum)
41     {
42         devInfo.devNum = devNum;
43     }
44 
getDevInfoStatus()45     int32_t getDevInfoStatus() const
46     {
47         return devInfo.status;
48     }
getDevInfoBusNum()49     int32_t getDevInfoBusNum() const
50     {
51         return devInfo.busNum;
52     }
getDevInfoDevNum()53     int32_t getDevInfoDevNum() const
54     {
55         return devInfo.devNum;
56     }
57 
58 private:
59     USBDeviceInfo devInfo;
60 };
61 } // namespace USB
62 } // namespace OHOS
63 
64 #endif // USBMGR_USB_INFO_H
65