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
6092dd18
Commit
6092dd18
authored
Apr 25, 2023
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0.9
parent
02260f0d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
33 deletions
+43
-33
main_app/build.gradle
+2
-2
main_app/src/main/java/com/ihaoin/hooloo/device/base/MachineInfoSocket.java
+10
-7
main_app/src/main/java/com/ihaoin/hooloo/device/interaction/InteractionSocket.java
+10
-8
main_app/src/main/java/com/ihaoin/hooloo/device/kds/KDSSocket.java
+10
-7
main_app/src/main/java/com/ihaoin/hooloo/device/update/UpdateSocket.java
+11
-9
No files found.
main_app/build.gradle
View file @
6092dd18
...
...
@@ -18,8 +18,8 @@ android {
applicationId
"com.ihaoin.hooloo.device"
minSdkVersion
26
targetSdkVersion
30
versionCode
8
versionName
"1.0.
8
"
versionCode
9
versionName
"1.0.
9
"
ndk
{
//选择要添加的对应 cpu 类型的 .so 库。
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/base/MachineInfoSocket.java
View file @
6092dd18
package
com
.
ihaoin
.
hooloo
.
device
.
base
;
import
android.content.Context
;
import
android.os.Handler
;
import
com.ihaoin.hooloo.device.data.vo.MachineInfoMsg
;
import
com.ihaoin.hooloo.device.util.CollectionUtils
;
...
...
@@ -41,13 +42,15 @@ 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
();
}
new
Handler
().
postDelayed
(()
->
{
try
{
mSocket
=
IO
.
socket
(
Base
.
NSP_MACHINE
);
mSocket
.
connect
();
}
catch
(
Exception
e
)
{
Utils
.
i
(
"连接server失败,错误原因:"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
},
1000
*
10
);
}
private
Emitter
.
Listener
onConnect
=
args
->
Utils
.
i
(
"machine socket connected"
);
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/interaction/InteractionSocket.java
View file @
6092dd18
package
com
.
ihaoin
.
hooloo
.
device
.
interaction
;
import
android.content.Context
;
import
android.os.Handler
;
import
com.ihaoin.hooloo.device.base.Base
;
import
com.ihaoin.hooloo.device.data.vo.InteractionMsg
;
...
...
@@ -42,14 +43,15 @@ 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
();
}
new
Handler
().
postDelayed
(()
->
{
try
{
mSocket
=
IO
.
socket
(
Base
.
NSP_INTERACTION
);
mSocket
.
connect
();
}
catch
(
Exception
e
)
{
Utils
.
i
(
"连接server失败,错误原因:"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
},
1000
*
10
);
}
private
Emitter
.
Listener
onConnect
=
args
->
{
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/kds/KDSSocket.java
View file @
6092dd18
package
com
.
ihaoin
.
hooloo
.
device
.
kds
;
import
android.content.Context
;
import
android.os.Handler
;
import
com.ihaoin.hooloo.device.base.Base
;
import
com.ihaoin.hooloo.device.data.vo.KDSMsg
;
...
...
@@ -42,13 +43,15 @@ 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
();
}
new
Handler
().
postDelayed
(()
->
{
try
{
mSocket
=
IO
.
socket
(
Base
.
NSP_KDS
);
mSocket
.
connect
();
}
catch
(
Exception
e
)
{
Utils
.
i
(
"连接server失败,错误原因:"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
},
1000
*
10
);
}
private
Emitter
.
Listener
onConnect
=
args
->
{
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/update/UpdateSocket.java
View file @
6092dd18
...
...
@@ -54,16 +54,18 @@ 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
);
new
Handler
().
postDelayed
(()
->
{
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
();
}
e
.
printStackTrace
();
}
},
1000
*
10
);
}
private
Emitter
.
Listener
onConnect
=
args
->
{
...
...
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