Skip to content

Commit

Permalink
Tag for alpha version 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdi-cpp committed Apr 4, 2023
1 parent 793c076 commit c0fac7c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ui/service/ResourceService.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ Q_OBJECT

Mirror *mirror = nullptr;

/** save serial for restart tcpip 5555 for first time. this cause we can access by Wi-Fi connection
* #adb -s RZ8NC0KA54H tcpip 5555
* #adb connect 192.168.1.161
**/
QList<QString> m_usb_serials;

public slots:

void setMirror(bool vlaue);
Expand Down
15 changes: 15 additions & 0 deletions ui/service/WebSocketService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,28 @@ void WebSocketService::response(int result) {
void WebSocketService::qmlEvents(QString command, QString data) {

if (command == "REQUEST_MIRROR_START") {

if (resourceService->m_usb_serials.indexOf(data) == -1) {//if not exist add to usb list and execute command
resourceService->m_usb_serials << data;

if (checkAdbRun()) {
return;
}
data = data.remove("\"");
m_adb.execute("", QStringList() << "-s" << data << "tcpip" << "5555");
}

resourceService->setSerial(data);
resourceService->setUsbMirrorParametre();
requestMirrorStart();

} else if (command == "REQUEST_MIRROR_FINISH") {

qsc::IDeviceManage::getInstance().disconnectDevice(resourceService->serial());
response(Server::SERVER_RESPONSE::MIRROR_FINISHED);

} else if (command == "REQUEST_DEVICES_LIST") {

if (checkAdbRun()) {
return;
}
Expand Down

0 comments on commit c0fac7c

Please sign in to comment.