Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
78b23091
Commit
78b23091
authored
Jun 28, 2022
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
吹付エラーの後、10秒経過後に「息を吹きかけてください」が表示されなかったのを修正した。
parent
97554d16
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
55 deletions
+31
-55
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/AlcoholCheckerUtil.java
+21
-50
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BleManagerUtil.java
+8
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+2
-5
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/AlcoholCheckerUtil.java
View file @
78b23091
...
...
@@ -146,23 +146,7 @@ public class AlcoholCheckerUtil {
// mutex
private
Object
lockObj
=
new
Object
();
public
AlcoholCheckerUtil
(
Context
context
,
AlcoholCheckerUtilListener
listener
)
{
this
.
context
=
context
;
isConnected
=
false
;
this
.
listener
=
listener
;
}
public
void
finish
()
{
isConnected
=
false
;
disconnect
();
}
// Bluetoothアダプタの取得処理
public
boolean
startGetDeviceInfo
()
{
// BLE管理
bleManagerUtil
=
new
BleManagerUtil
(
context
,
new
BleManagerUtilListener
()
{
public
BleManagerUtilListener
bleManagerUtilListener
=
new
BleManagerUtilListener
()
{
@Override
public
void
onGetDeviceInfoFailed
(
int
status
)
{
...
...
@@ -176,38 +160,12 @@ public class AlcoholCheckerUtil {
@Override
public
void
onConnectionState
(
int
status
)
{
// Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
// Logger.i(TAG,"onConnectionState = %s", status);
// Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
// if (status == BluetoothProfile.STATE_CONNECTED) {
// Log.d(TAG, "Connected to GATT server.");
//
// // ペリフェラルとの接続に成功した時点でサービスを検索する
// if (bleManagerUtil.mBluetoothGatt.discoverServices()) {
// Logger.d(TAG, "Started discovering services");
// } else {
// Logger.d(TAG, "Failed to start discovering services");
// }
// isConnected = true;
//
// } else if (status == BluetoothProfile.STATE_DISCONNECTED) {
//
// if (bleManagerUtil.mBluetoothGatt == null) {
// return;
// } else {
// Logger.i(TAG, "Disconnected from GATT server.");
// listener.onConnectionError(19);
// }
// } else {
// Logger.i(TAG,"UNKNOW STATE = " + status);
// }
Logger
.
d
(
TAG
,
"onConnectionState = %s"
,
status
);
}
@Override
public
void
onDisConnectionState
()
{
// Logger.d(TAG,"onDisConnectionState");
// listener.onConnectionError(0);
// //isConnected = false;
}
@Override
...
...
@@ -218,9 +176,7 @@ public class AlcoholCheckerUtil {
@Override
public
void
onServicesDiscovered
(
int
status
)
{
//Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
Logger
.
i
(
TAG
,
"onServicesDiscovered = %s"
,
status
);
//Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
if
(
status
==
BluetoothGatt
.
GATT_SUCCESS
)
{
Logger
.
i
(
TAG
,
"BluetoothGatt.GATT_SUCCESS"
);
...
...
@@ -231,11 +187,9 @@ public class AlcoholCheckerUtil {
// Check TX and RX UUIDs
RxChar
=
TaiyoYudenService
.
getCharacteristic
(
RX_CHARACTERISTIC_UUID
);
TxChar
=
TaiyoYudenService
.
getCharacteristic
(
TX_CHARACTERISTIC_UUID
);
//Logger.i(TAG,"iiiiiiiiiiiiiiiiiiiiiii");
if
(
RxChar
==
null
||
TxChar
==
null
)
{
Logger
.
e
(
TAG
,
"No Tx/Rx"
);
}
else
{
//Logger.i(TAG,"iiiiiiiiiiiiiiiiiiiiiii");
gi_status
=
F_BLE_COM_INIT
;
gi_rxlength
=
0
;
...
...
@@ -334,7 +288,24 @@ public class AlcoholCheckerUtil {
Logger
.
d
(
TAG
,
"Wrote descriptor: "
+
BATTERY_LEVEL_UUID
);
}
}
});
};
public
AlcoholCheckerUtil
(
Context
context
,
AlcoholCheckerUtilListener
listener
)
{
this
.
context
=
context
;
isConnected
=
false
;
this
.
listener
=
listener
;
}
public
void
finish
()
{
isConnected
=
false
;
disconnect
();
}
// Bluetoothアダプタの取得処理
public
boolean
startGetDeviceInfo
()
{
// BLE管理
bleManagerUtil
=
new
BleManagerUtil
(
context
,
bleManagerUtilListener
);
if
(!
bleManagerUtil
.
startDeviceInfo
())
{
return
false
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BleManagerUtil.java
View file @
78b23091
...
...
@@ -420,4 +420,12 @@ public class BleManagerUtil {
mBluetoothGatt
.
readPhy
();
return
true
;
}
/**
* リスナー設定
* @param listener リスナー
*/
public
void
setListener
(
BleManagerUtilListener
listener
)
{
mListener
=
listener
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
78b23091
...
...
@@ -273,10 +273,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
*/
private
void
initAlcoholCheckerUtil
()
{
Logger
.
i
(
TAG
,
"initAlcoholCheckerUtil"
);
if
(
alcoholCheckerUtil
!=
null
)
{
checkerStatus
=
AlcoholCheckerUtil
.
fugo_init
;
return
;
}
alcoholCheckerUtil
=
new
AlcoholCheckerUtil
(
this
,
new
AlcoholCheckerUtilListener
()
{
...
...
@@ -341,7 +337,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public
void
run
()
{
if
(
isFromError
)
{
if
(
mMeasureDialog
!=
null
)
{
mMeasureDialog
.
setMessage
(
getString
(
R
.
string
.
msg_breath_error
));
mMeasureDialog
.
setMessage
(
getString
(
R
.
string
.
wait_breathe
));
}
}
else
{
if
(
mWaitMeasureDialog
!=
null
)
{
...
...
@@ -563,6 +559,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
isInitBLE
=
true
;
}
}
alcoholCheckerUtil
.
bleManagerUtil
.
setListener
(
alcoholCheckerUtil
.
bleManagerUtilListener
);
if
(!
isInitAlcChecker
)
{
// アルコールチェッカー接続
connectToAlcholChecker
();
...
...
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