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
3e48ada3
Commit
3e48ada3
authored
Jun 21, 2022
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#47941 HW連携 アルコールチェッカーから値を取得する処理を追加中6
iOSとふるまいを同じにした。
parent
32a57b15
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
19 deletions
+31
-19
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/AlcoholCheckerUtil.java
+3
-5
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BleManagerUtil.java
+11
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+17
-10
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/AlcoholCheckerUtil.java
View file @
3e48ada3
...
...
@@ -139,10 +139,9 @@ public class AlcoholCheckerUtil {
}
public
void
finish
()
{
sendMessage
(
AlcoholCheckerUtil
.
F_BLE_COM_FC_COMMAND_F11
);
isConnected
=
false
;
//
stopAlcTimer();
//
disconnect(true);
stopAlcTimer
();
disconnect
(
true
);
}
// Bluetoothアダプタの取得処理
...
...
@@ -174,8 +173,6 @@ public class AlcoholCheckerUtil {
Logger
.
i
(
TAG
,
"Disconnected from GATT server."
);
listener
.
onConnectionError
(
19
);
}
//finish();
}
else
{
Logger
.
i
(
TAG
,
"UNKNOW STATE = "
+
status
);
}
...
...
@@ -193,6 +190,7 @@ public class AlcoholCheckerUtil {
Logger
.
i
(
TAG
,
"onConnectionError = %s"
,
status
);
listener
.
onConnectionError
(
status
);
isConnected
=
false
;
stopAlcTimer
();
disconnect
(
true
);
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BleManagerUtil.java
View file @
3e48ada3
...
...
@@ -79,8 +79,17 @@ public class BleManagerUtil {
@Override
public
void
run
()
{
// 接続完了
if
(
mBluetoothGatt
==
null
||
!
mBluetoothGatt
.
discoverServices
())
{
// サービス検索
boolean
isGattaNull
=
false
;
boolean
isNotDiscoverService
=
false
;
if
(
mBluetoothGatt
!=
null
)
{
if
(!
mBluetoothGatt
.
discoverServices
())
{
isNotDiscoverService
=
true
;
}
}
if
(
mBluetoothGatt
==
null
)
{
isGattaNull
=
true
;
}
if
(
isGattaNull
||
isNotDiscoverService
)
{
runOnUiThread
(
new
Runnable
()
{
// 接続失敗
@Override
public
void
run
()
{
...
...
@@ -99,8 +108,6 @@ public class BleManagerUtil {
disconnect
(
true
);
return
;
}
mListener
.
onConnectionState
(
status
);
}
// サービス検索が完了したときの処理(mBluetoothGatt.discoverServices()の結果として呼ばれる。)
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
3e48ada3
...
...
@@ -418,19 +418,26 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public
void
run
()
{
closeAllDialog
();
if
(
isFinish
)
{
// BLE接続を解除して接続方法選択状態に戻る(基本中止(キャンセルは切断)
alcoholCheckerUtil
.
sendMessage
(
AlcoholCheckerUtil
.
F_BLE_COM_FC_COMMAND_F11
);
alcoholCheckerUtil
.
finish
();
}
else
{
// BLEは切断しないが測定中断、測定開始状態に戻す(測定完了した場合は、RDYに戻す
alcoholCheckerUtil
.
sendMessage
(
AlcoholCheckerUtil
.
F_BLE_COM_FC_COMMAND_F22
);
}
JSONObject
responseJson
=
new
JSONObject
();
responseJson
.
put
(
ABookKeys
.
TASK_QUESTION_ID
,
mQid
);
responseJson
.
put
(
"value"
,
value
);
afterABookCheckApi
(
mCmd
,
""
,
0
,
""
,
responseJson
.
toString
());
Logger
.
i
(
TAG
,
"successAfterAbookCheckAip JSON [%s]"
,
responseJson
.
toString
());
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
isFinish
)
{
// BLE接続を解除して接続方法選択状態に戻る(基本中止(キャンセルは切断)
alcoholCheckerUtil
.
sendMessage
(
AlcoholCheckerUtil
.
F_BLE_COM_FC_COMMAND_F11
);
alcoholCheckerUtil
.
finish
();
}
else
{
// BLEは切断しないが測定中断、測定開始状態に戻す(測定完了した場合は、RDYに戻す
alcoholCheckerUtil
.
sendMessage
(
AlcoholCheckerUtil
.
F_BLE_COM_FC_COMMAND_F22
);
}
}
},
1000
);
}
});
}
...
...
@@ -445,9 +452,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public
void
run
()
{
closeAllDialog
();
// BLE接続を解除して接続方法選択状態に戻る(基本中止(キャンセルは切断)
//
alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11);
alcoholCheckerUtil
.
sendMessage
(
AlcoholCheckerUtil
.
F_BLE_COM_FC_COMMAND_F11
);
alcoholCheckerUtil
.
finish
();
//
afterABookCheckApi(mCmd, "", 1, errorMessage, null);
afterABookCheckApi
(
mCmd
,
""
,
1
,
errorMessage
,
null
);
Logger
.
e
(
TAG
,
errorMessage
);
}
});
...
...
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