Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
android
machine
Commits
02260f0d
Commit
02260f0d
authored
Apr 23, 2023
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0.8
parent
0c7fa28d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
6 deletions
+60
-6
main_app/build.gradle
+2
-2
main_app/src/main/java/com/ihaoin/hooloo/device/base/MachineInfoSocket.java
+14
-1
main_app/src/main/java/com/ihaoin/hooloo/device/interaction/InteractionSocket.java
+15
-1
main_app/src/main/java/com/ihaoin/hooloo/device/kds/KDSSocket.java
+14
-1
main_app/src/main/java/com/ihaoin/hooloo/device/update/UpdateSocket.java
+15
-1
release-apk/main_app-release_8_1.0.8.apk
+0
-0
No files found.
main_app/build.gradle
View file @
02260f0d
...
@@ -18,8 +18,8 @@ android {
...
@@ -18,8 +18,8 @@ android {
applicationId
"com.ihaoin.hooloo.device"
applicationId
"com.ihaoin.hooloo.device"
minSdkVersion
26
minSdkVersion
26
targetSdkVersion
30
targetSdkVersion
30
versionCode
7
versionCode
8
versionName
"1.0.
7
"
versionName
"1.0.
8
"
ndk
{
ndk
{
//选择要添加的对应 cpu 类型的 .so 库。
//选择要添加的对应 cpu 类型的 .so 库。
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/base/MachineInfoSocket.java
View file @
02260f0d
...
@@ -40,9 +40,22 @@ public class MachineInfoSocket extends Thread {
...
@@ -40,9 +40,22 @@ public class MachineInfoSocket extends Thread {
}
}
}
}
private
void
reconnect
()
{
try
{
mSocket
=
IO
.
socket
(
Base
.
NSP_MACHINE
);
mSocket
.
connect
();
}
catch
(
Exception
e
)
{
Utils
.
i
(
"连接server失败,错误原因:"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
}
private
Emitter
.
Listener
onConnect
=
args
->
Utils
.
i
(
"machine socket connected"
);
private
Emitter
.
Listener
onConnect
=
args
->
Utils
.
i
(
"machine socket connected"
);
private
Emitter
.
Listener
onDisconnect
=
args
->
Utils
.
i
(
"machine socket disconnected"
);
private
Emitter
.
Listener
onDisconnect
=
args
->
{
Utils
.
i
(
"machine socket disconnected"
);
reconnect
();
};
public
void
close
()
{
public
void
close
()
{
try
{
try
{
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/interaction/InteractionSocket.java
View file @
02260f0d
...
@@ -41,12 +41,26 @@ public class InteractionSocket extends Thread {
...
@@ -41,12 +41,26 @@ public class InteractionSocket extends Thread {
}
}
}
}
private
void
reconnect
()
{
try
{
mSocket
=
IO
.
socket
(
Base
.
NSP_INTERACTION
);
mSocket
.
connect
();
}
catch
(
Exception
e
)
{
Utils
.
i
(
"连接server失败,错误原因:"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
}
private
Emitter
.
Listener
onConnect
=
args
->
{
private
Emitter
.
Listener
onConnect
=
args
->
{
Utils
.
i
(
"interaction socket connected"
);
Utils
.
i
(
"interaction socket connected"
);
mSocket
.
emit
(
"notice"
,
"test"
,
(
Ack
)
ack
->
process
(
"notice"
,
ack
));
mSocket
.
emit
(
"notice"
,
"test"
,
(
Ack
)
ack
->
process
(
"notice"
,
ack
));
};
};
private
Emitter
.
Listener
onDisconnect
=
args
->
Utils
.
i
(
"interaction socket disconnected"
);
private
Emitter
.
Listener
onDisconnect
=
args
->
{
Utils
.
i
(
"interaction socket disconnected"
);
reconnect
();
};
private
Emitter
.
Listener
onReply
=
args
->
{
private
Emitter
.
Listener
onReply
=
args
->
{
Utils
.
i
(
"interaction socket reply"
);
Utils
.
i
(
"interaction socket reply"
);
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/kds/KDSSocket.java
View file @
02260f0d
...
@@ -41,12 +41,25 @@ public class KDSSocket extends Thread {
...
@@ -41,12 +41,25 @@ public class KDSSocket extends Thread {
}
}
}
}
private
void
reconnect
()
{
try
{
mSocket
=
IO
.
socket
(
Base
.
NSP_KDS
);
mSocket
.
connect
();
}
catch
(
Exception
e
)
{
Utils
.
i
(
"连接server失败,错误原因:"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
}
private
Emitter
.
Listener
onConnect
=
args
->
{
private
Emitter
.
Listener
onConnect
=
args
->
{
Utils
.
i
(
"kds socket connected"
);
Utils
.
i
(
"kds socket connected"
);
mSocket
.
emit
(
"notice"
,
"test"
,
(
Ack
)
ack
->
Utils
.
i
(
"notice: "
+
JsonUtils
.
toString
(
ack
)));
mSocket
.
emit
(
"notice"
,
"test"
,
(
Ack
)
ack
->
Utils
.
i
(
"notice: "
+
JsonUtils
.
toString
(
ack
)));
};
};
private
Emitter
.
Listener
onDisconnect
=
args
->
Utils
.
i
(
"kds socket disconnected"
);
private
Emitter
.
Listener
onDisconnect
=
args
->
{
Utils
.
i
(
"kds socket disconnected"
);
reconnect
();
};
private
Emitter
.
Listener
onReply
=
args
->
{
private
Emitter
.
Listener
onReply
=
args
->
{
Utils
.
i
(
"kds socket reply"
);
Utils
.
i
(
"kds socket reply"
);
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/update/UpdateSocket.java
View file @
02260f0d
...
@@ -53,6 +53,19 @@ public class UpdateSocket extends Thread {
...
@@ -53,6 +53,19 @@ public class UpdateSocket extends Thread {
}
}
}
}
private
void
reconnect
()
{
try
{
mSocket
=
IO
.
socket
(
Base
.
NSP_UPGRADE
);
mSocket
.
connect
();
}
catch
(
Exception
e
)
{
Utils
.
i
(
AppConfig
.
TAG_UPDATE
,
"连接server失败,错误原因:"
+
e
.
getMessage
());
if
(
AppConfig
.
DEBUG
)
{
Utils
.
showToast
(
mContext
,
"连接server失败,错误原因:"
+
e
.
getMessage
(),
Toast
.
LENGTH_LONG
);
}
e
.
printStackTrace
();
}
}
private
Emitter
.
Listener
onConnect
=
args
->
{
private
Emitter
.
Listener
onConnect
=
args
->
{
Utils
.
i
(
AppConfig
.
TAG_UPDATE
,
"update socket connected"
);
Utils
.
i
(
AppConfig
.
TAG_UPDATE
,
"update socket connected"
);
if
(
AppConfig
.
DEBUG
)
{
if
(
AppConfig
.
DEBUG
)
{
...
@@ -62,7 +75,8 @@ public class UpdateSocket extends Thread {
...
@@ -62,7 +75,8 @@ public class UpdateSocket extends Thread {
};
};
private
Emitter
.
Listener
onDisconnect
=
args
->
{
private
Emitter
.
Listener
onDisconnect
=
args
->
{
Utils
.
i
(
AppConfig
.
TAG_UPDATE
,
"update socket disconnected"
);
Utils
.
i
(
AppConfig
.
TAG_UPDATE
,
"update socket disconnected"
);;
reconnect
();
if
(
AppConfig
.
DEBUG
)
{
if
(
AppConfig
.
DEBUG
)
{
Utils
.
showToast
(
mContext
,
"update socket, 断开连接"
,
Toast
.
LENGTH_LONG
);
Utils
.
showToast
(
mContext
,
"update socket, 断开连接"
,
Toast
.
LENGTH_LONG
);
}
}
...
...
release-apk/main_app-release_8_1.0.8.apk
0 → 100644
View file @
02260f0d
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment