Skip to content

Commit 9a2f3a0

Browse files
committed
Created new struct to represent a device.
1 parent be7385b commit 9a2f3a0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

pkg/adb/devices.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
Copyright 2019 Left Technologies Inc.
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+
package adb
18+
19+
// Device represents a connected device as reported by `adb devices -l`.
20+
// See https://developer.android.com/studio/command-line/adb#devicestatus
21+
type Device struct {
22+
// This device's unique ID on this host machine.
23+
// e.g. 1
24+
TransportID int
25+
26+
// The device's serial ID. Not guaranteed to be unique.
27+
// e.g. "0a388e93"
28+
SerialID string
29+
30+
// The device's state.
31+
// One of "authorized", "unauthorized", "authorizing", "device", "offline", "no device".
32+
State string
33+
34+
// The USB port the device is connected to.
35+
// e.g. "1-1.4.2"
36+
Usb string
37+
38+
// Optional, the device's product name.
39+
// e.g., "razor"
40+
Product string
41+
42+
// Optional, the device's model name.
43+
// e.g. "Nexus_7"
44+
Model string
45+
46+
// Optional, the device's name.
47+
// e.g. "flo"
48+
Device string
49+
}

0 commit comments

Comments
 (0)