Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fe388104
authored
Mar 08, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
现在通过Build.MODEL来判断机型,而非Build.DEVICE
parent
bdf84ee9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
app/src/main/java/com/bgycc/smartcanteen/qrcode/QRCodeScanFactory.java
+5
-5
app/src/main/java/com/bgycc/smartcanteen/qrcode/QUAD.java
+2
-2
No files found.
app/src/main/java/com/bgycc/smartcanteen/qrcode/QRCodeScanFactory.java
View file @
fe388104
...
@@ -4,15 +4,15 @@ import android.os.Build;
...
@@ -4,15 +4,15 @@ import android.os.Build;
public
class
QRCodeScanFactory
{
public
class
QRCodeScanFactory
{
private
static
final
String
TPS
=
"TPS"
;
private
static
final
String
TPS
=
"TPS"
;
private
static
final
String
T3
=
"56iqDS
"
;
private
static
final
String
QUAD
=
"QUAD
"
;
private
static
final
String
TPS_PORT
=
"/dev/ttyS0"
;
private
static
final
String
TPS_PORT
=
"/dev/ttyS0"
;
private
static
final
String
T3
_PORT
=
"/dev/ttyS6"
;
private
static
final
String
QUAD
_PORT
=
"/dev/ttyS6"
;
public
static
IQRCodeScan
create
()
throws
Exception
{
public
static
IQRCodeScan
create
()
throws
Exception
{
if
(
Build
.
DEVICE
.
contains
(
TPS
))
{
if
(
Build
.
MODEL
.
contains
(
TPS
))
{
return
new
TPS
(
TPS_PORT
);
return
new
TPS
(
TPS_PORT
);
}
else
if
(
Build
.
DEVICE
.
contains
(
T3
))
{
}
else
if
(
Build
.
DEVICE
.
contains
(
QUAD
))
{
return
new
T3
(
T3
_PORT
);
return
new
QUAD
(
QUAD
_PORT
);
}
else
{
}
else
{
throw
new
RuntimeException
(
"不明设备型号: "
+
Build
.
DEVICE
);
throw
new
RuntimeException
(
"不明设备型号: "
+
Build
.
DEVICE
);
}
}
...
...
app/src/main/java/com/bgycc/smartcanteen/qrcode/
T3
.java
→
app/src/main/java/com/bgycc/smartcanteen/qrcode/
QUAD
.java
View file @
fe388104
...
@@ -2,10 +2,10 @@ package com.bgycc.smartcanteen.qrcode;
...
@@ -2,10 +2,10 @@ package com.bgycc.smartcanteen.qrcode;
import
android_serialport_api.SerialPort
;
import
android_serialport_api.SerialPort
;
public
class
T3
extends
BaseQRCodeScan
{
public
class
QUAD
extends
BaseQRCodeScan
{
private
SerialPort
serial
;
private
SerialPort
serial
;
public
T3
(
String
filePath
)
throws
Exception
{
public
QUAD
(
String
filePath
)
throws
Exception
{
serial
=
new
SerialPort
(
filePath
,
115200
,
0
);
serial
=
new
SerialPort
(
filePath
,
115200
,
0
);
setup
(
serial
.
getInputStream
());
setup
(
serial
.
getInputStream
());
}
}
...
...
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