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