microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/extension/networkInspector/devices/baseClientDevice.ts
54lines · modeblame
4bb0956eRedMickey5 years ago | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. | |
| 3 | | |
4cd25962JiglioNero4 years ago | 4 | import { ITarget } from "../../mobileTarget"; |
4bb0956eRedMickey5 years ago | 5 | import { ClientOS } from "../clientUtils"; |
| 6 | | |
| 7 | export enum DeviceStatus { | |
| 8 | Prepared, | |
| 9 | NotPrepared, | |
| 10 | } | |
| 11 | | |
4cd25962JiglioNero4 years ago | 12 | export class BaseClientDevice implements ITarget { |
4bb0956eRedMickey5 years ago | 13 | // operating system of this device |
4cd25962JiglioNero4 years ago | 14 | protected _os: ClientOS; |
4bb0956eRedMickey5 years ago | 15 | // human readable name for this device |
4cd25962JiglioNero4 years ago | 16 | protected _name?: string; |
4bb0956eRedMickey5 years ago | 17 | // type of this device |
4cd25962JiglioNero4 years ago | 18 | protected _isVirtualTarget: boolean; |
4bb0956eRedMickey5 years ago | 19 | // serial number for this device |
4cd25962JiglioNero4 years ago | 20 | protected _id: string; |
| 21 | protected _deviceStatus: DeviceStatus; | |
4bb0956eRedMickey5 years ago | 22 | |
4cd25962JiglioNero4 years ago | 23 | constructor(id: string, isVirtualTarget: boolean, os: ClientOS, name?: string) { |
4bb0956eRedMickey5 years ago | 24 | this._id = id; |
| 25 | this._name = name; | |
4cd25962JiglioNero4 years ago | 26 | this._isVirtualTarget = isVirtualTarget; |
4bb0956eRedMickey5 years ago | 27 | this._os = os; |
| 28 | this._deviceStatus = DeviceStatus.NotPrepared; | |
| 29 | } | |
| 30 | | |
| 31 | get id(): string { | |
| 32 | return this._id; | |
| 33 | } | |
| 34 | | |
| 35 | get os(): ClientOS { | |
| 36 | return this._os; | |
| 37 | } | |
| 38 | | |
| 39 | get name(): string | undefined { | |
| 40 | return this._name; | |
| 41 | } | |
| 42 | | |
4cd25962JiglioNero4 years ago | 43 | get isVirtualTarget(): boolean { |
| 44 | return this._isVirtualTarget; | |
4bb0956eRedMickey5 years ago | 45 | } |
| 46 | | |
| 47 | get deviceStatus(): DeviceStatus { | |
| 48 | return this._deviceStatus; | |
| 49 | } | |
| 50 | | |
| 51 | set deviceStatus(deviceStatus: DeviceStatus) { | |
| 52 | this._deviceStatus = deviceStatus; | |
| 53 | } | |
| 54 | } |