Skip to content

Commit

Permalink
added ability to manually connect to wifi
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Harris committed Aug 6, 2022
1 parent 50bcaaf commit 0c9b4ac
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion desktop-app/src/app/adb-client.service.ts
Expand Up @@ -135,7 +135,7 @@ export class AdbClientService {
return this.deviceStatus === ConnectionStatus.CONNECTED;
}
runAdbCommand(adbCommandToRun, skipSettingResponse?: boolean) {
if (this.deviceStatus !== ConnectionStatus.CONNECTED) {
if (this.deviceStatus !== ConnectionStatus.CONNECTED && !adbCommandToRun.startsWith('adb connect ')) {
return Promise.reject('Adb command failed - No device connected!');
}
if (!skipSettingResponse) {
Expand Down
Expand Up @@ -293,7 +293,6 @@ export class HeadsetSettingsComponent implements OnInit {
);
})
.catch(e => this.statusService.showStatus(e, true));
console.log(this.videoCaptureSize);
}
setGuardian(guardian: GU) {
this.runAdbCommand('setprop debug.oculus.guardian_pause ' + (guardian === GU.ON ? 0 : 1))
Expand Down
@@ -1,8 +1,13 @@
<div class="inner-app-container">
<div *ngIf="!isConnected()">
<br>You are not currently connected.
<br>You are not currently connected. You can try entering your quest IP, if Wireless ADB is enabled then it will connect.
<br><br>
<div class="pure-material-button-contained" routerLink="/setup">Open Setup Instructions</div>
<div class="pure-material-button-contained spaced" routerLink="/setup">Open Setup Instructions</div>
<div class="pure-material-button-contained spaced" (click)="wifiConnectModal.openModal()">Enter IP to connect</div>
<br><br>
<ng-container *ngIf="adbService.deviceIp">
Last known device IP: {{adbService.deviceIp}}
</ng-container>
</div>
<div *ngIf="isConnected()">
<div class="screen-description">Enable wifi mode to install apps wirelessly. You must be connected with USB to enable wifi mode.</div>
Expand All @@ -23,3 +28,24 @@
</div>

</div>

<mz-modal #wifiConnectModal [fixedFooter]="true">
<mz-modal-header>
<h4>Enter Quest Wifi IP</h4>
</mz-modal-header>
<mz-modal-content>
If you previously enable Wireless ADB on your headset then you can enter the IP to connect here.

<br><br>
<div class="button-section">
<div class="input-field">
<input id="adbCommand" type="text" [(ngModel)]="connectWifiIp" placeholder="IP address like 192.168..." />
</div>
</div>
<br>
</mz-modal-content>
<mz-modal-footer>
<div class="pure-material-button-contained flat active spaced" (click)="wifiConnectModal.closeModal(); ">Close</div>
<div class="pure-material-button-contained spaced" (click)="wifiConnectModal.closeModal(); connectManualWifi()">Connect</div>
</mz-modal-footer>
</mz-modal>
Expand Up @@ -9,9 +9,13 @@ import { StatusBarService } from '../status-bar.service';
styleUrls: ['./wireless-connection.component.scss'],
})
export class WirelessConnectionComponent implements OnInit {
connectWifiIp: string;
constructor(public adbService: AdbClientService, appService: AppService, private statusService: StatusBarService) {
appService.webService.isWebviewOpen = false;
appService.resetTop();
if (adbService.deviceIp) {
this.connectWifiIp = adbService.deviceIp;
}
}

ngOnInit() {}
Expand Down Expand Up @@ -40,4 +44,8 @@ export class WirelessConnectionComponent implements OnInit {
// }
return isConnected;
}

connectManualWifi() {
this.adbService.runAdbCommand('adb connect ' + this.connectWifiIp + ':5555', true);
}
}
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "SideQuest",
"productName": "SideQuest",
"version": "0.10.30",
"version": "0.10.31",
"description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.",
"repository": "https://github.com/SideQuestVR/SideQuest.git",
"license": "UNLICENCED",
Expand Down

0 comments on commit 0c9b4ac

Please sign in to comment.