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
42d06081
Commit
42d06081
authored
Jul 16, 2020
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Task #39006 【@Form】(要望)中心温度計 放射温度計の連続計測対応 onDestroy以外はBluetoothを切断しないに修正
parent
f51e9edf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
13 deletions
+83
-13
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVCheckContentViewActivity.java
+76
-6
gradle.properties
+7
-7
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVCheckContentViewActivity.java
View file @
42d06081
...
...
@@ -5,6 +5,7 @@ import android.app.PendingIntent;
import
android.bluetooth.BluetoothAdapter
;
import
android.bluetooth.BluetoothDevice
;
import
android.bluetooth.BluetoothSocket
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
...
...
@@ -123,6 +124,8 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
// SPP通信機器のデバイスID(t_spp_device)
private
Integer
mSppDeviceId
;
private
boolean
isConnection
;
/**
* Beaconスキャン結果受信Receiver.
*/
...
...
@@ -186,6 +189,10 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"onCreate"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
/** 置くだけセンサーデバイス関連 開始 **/
//ビーコンスキャナー
mScanner
=
new
BeaconScanner
(
this
);
...
...
@@ -206,7 +213,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
bleManagerUtil
=
new
BleManagerUtil
(
this
,
new
BleManagerUtil
.
BleManagerUtilListener
()
{
@Override
public
void
onConnectionError
(
int
status
)
{
//bluetooth接続エラー
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
e
(
TAG
,
"onConnectionError"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
// bluetoothのデバイスタイプ(中心温度計・放射温度計)
int
bluetoothDeviceType
=
bleManagerUtil
.
getBluetoothDeviceType
();
// タイプによってメッセージ内容をセット
...
...
@@ -224,12 +233,15 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
errorAfterAbookCheckAip
(
String
.
format
(
getString
(
R
.
string
.
msg_bluetooth_connect_error
),
getString
(
R
.
string
.
radiation_thermometer
)));
}
}
bleManagerDisconnect
();
// onuma
bleManagerDisconnect
(
true
);
}
@Override
public
void
onConnectionState
()
{
// bluetooth接続成功
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"onConnectionState"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
//ダイアログが非表示になっても、何回呼ばれることがあるので、ダイアログのnullチェックする。
if
(
mWaitingDialog
!=
null
)
{
String
message
=
null
;
...
...
@@ -244,8 +256,11 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
if
(
StringUtil
.
isNullOrEmpty
(
message
))
{
// 接続するデバイスが存在しないと見做し、接続を切る
bleManagerDisconnect
();
// onuma
bleManagerDisconnect
(
false
);
}
else
{
// onuma
isConnection
=
true
;
mWaitingDialog
.
setMessage
(
message
);
}
}
...
...
@@ -253,21 +268,32 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
@Override
public
void
onDisConnectionState
()
{
// bluetooth接続切断
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"onDisConnectionState"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
// setThermometerData("");
// onuma 何もしない。オリジナルコードもダイアログを消すだけで、何もしていない
isConnection
=
false
;
dismissWaitngDialog
();
}
@Override
public
void
onGetDeviceInfo
(
String
strTemp
)
{
// bluetooth機器からデータ取得成功
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"onGetDeviceInfo temperature [%s]"
,
strTemp
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
setThermometerData
(
strTemp
);
bleManagerDisconnect
();
// 取得できたら、ダイアログ消すだけ。
// onuma
bleManagerDisconnect
(
false
);
dismissWaitngDialog
();
}
@Override
public
void
onGetDeviceInfoFailed
(
int
status
)
{
// bluetooth機器からデータ取得エラー
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
e
(
TAG
,
"onGetDeviceInfoFailed"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
// bluetoothのデバイスタイプ(中心温度計・放射温度計)
int
bluetoothDeviceType
=
bleManagerUtil
.
getBluetoothDeviceType
();
String
errorMessage
=
null
;
...
...
@@ -282,7 +308,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
errorAfterAbookCheckAip
(
errorMessage
);
}
// bluetooth通信を切断
bleManagerDisconnect
();
//onuma
bleManagerDisconnect
(
true
);
// ダイアログを閉じる
dismissWaitngDialog
();
}
...
...
@@ -309,11 +337,15 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
@Override
protected
void
onDestroy
()
{
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"onDestroy"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
//Beacon受信停止
unregisterReceiver
(
mReceiver
);
// 接続されている機器と切断する。
bleManagerDisconnect
();
// onuma
bleManagerDisconnect
(
true
);
super
.
onDestroy
();
}
...
...
@@ -462,6 +494,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
*/
@Override
protected
void
getDeviceInfo
(
Map
<
String
,
String
>
abookCheckParam
)
{
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"getDeviceInfo"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
if
(
abookCheckParam
.
containsKey
(
ABookKeys
.
TASK_DEVICE_TYPE
))
{
mDeviceType
=
Integer
.
valueOf
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_DEVICE_TYPE
));
// ディバイスのタイプ取得
...
...
@@ -572,6 +607,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
* @param message 内容
*/
private
void
showWaitingDialog
(
String
title
,
String
message
)
{
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"showWaitingDialog"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
//待機状態のダイヤログ表示
mWaitingDialog
=
AlertDialogUtil
.
createAlertDialog
(
this
,
title
);
mWaitingDialog
.
setMessage
(
message
);
...
...
@@ -582,7 +620,11 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
switch
(
mDeviceType
)
{
case
DeviceType
.
centerThermomete
:
case
DeviceType
.
radiationThermomete
:
bleManagerDisconnect
();
// 中心温度計接続切断
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"中止"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
//onuma
bleManagerDisconnect
(
true
);
// 中心温度計接続切断
break
;
case
DeviceType
.
sensor
:
stopOkudakeBeaconScan
();
// 置くだけセンサースキャン中止
...
...
@@ -643,6 +685,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
* BLEディバイスの放射温度計の情報取得
*/
private
void
setRadiationThermometerDeviceInfo
()
{
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"setRadiationThermometerDeviceInfo"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
if
(
requestBluetoothFeature
(
REQUEST_CODE_ENABLEBLUETOOTH_RADIATION_TEMPERATURE
))
{
//端末のBluetooth設定を確認
String
deviceAddress
=
getABVUIDataCache
().
getPairingBluetoothDeviceAddress
(
DeviceType
.
radiationThermomete
);
if
(
StringUtil
.
isNullOrEmpty
(
deviceAddress
))
{
...
...
@@ -652,12 +697,21 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
return
;
// 以下の処理にかからないようにreturnする
}
if
(
isConnection
)
{
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"isConnection = true"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
String
message
=
String
.
format
(
getString
(
R
.
string
.
msg_ble_connect_success
),
getString
(
R
.
string
.
radiation_thermometer
));
showWaitingDialog
(
getString
(
R
.
string
.
radiation_thermometer
),
message
);
}
else
{
// 登録されている放射温度計がある
showWaitingDialog
(
getString
(
R
.
string
.
radiation_thermometer
),
getString
(
R
.
string
.
ble_connecting
));
// 接続
bleManagerUtil
.
connect
(
DeviceType
.
radiationThermomete
,
deviceAddress
);
}
}
}
/**
* SPP機器の通信情報をセット
...
...
@@ -876,9 +930,23 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
/**
* 中心温度計の接続を切る
* #39006 【@Form】(要望)中心温度計 放射温度計の連続計測対応
*/
protected
void
bleManagerDisconnect
()
{
// onuma ここでは切らない
//bleManagerUtil.disconnect(true);
}
private
void
bleManagerDisconnect
(
boolean
disconnect
)
{
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"bleManagerDisconnect = "
+
disconnect
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
if
(
disconnect
){
isConnection
=
false
;
bleManagerUtil
.
disconnect
(
true
);
}
else
{
// 何もしない
}
}
/**
...
...
@@ -1005,7 +1073,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
@Override
protected
void
onStop
()
{
super
.
onStop
();
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
Logger
.
d
(
TAG
,
"--onStop"
);
Logger
.
d
(
TAG
,
"-------------------------------------------------"
);
// SPP通信の接続を切る
disConnectSppBluetooth
();
...
...
gradle.properties
View file @
42d06081
...
...
@@ -32,18 +32,18 @@ keyaliaspassword=micrOSoft_!sa1ko
android.useDeprecatedNdk
=
true
# Launcher AndroidManifest.xml
app_custompackagename
=
jp.co.
sato.atform
app_custompackagename
=
jp.co.
agentec.abookplus.check.dev
app_versioncode
=
1
# abvEnvironments.xml
#cms server
acms_address
=
https://
check.abookcloud.com
/acms
download_server_address
=
https://
check.abookcloud.com
/acms
acms_address
=
https://
abook188-1.abook.bz
/acms
download_server_address
=
https://
abook188-1.abook.bz
/acms
#syncview server
websocket_server_http_url
=
http
s://abook188-1
.abook.bz/v1
websocket_server_ws_url
=
ws
s://abook188-1
.abook.bz/v1
websocket_server_http_url
=
http
://abook188
.abook.bz/v1
websocket_server_ws_url
=
ws
://abook188
.abook.bz/v1
#WebSocket debug出力
websocket_debug
=
false
...
...
@@ -127,4 +127,4 @@ BLJAR_NAME=ABVJE_BL.jar
#store用の場合、armv7,x86両方ビルド
#storeではない場合、armv7のみビルド
isStoreProduct
=
false
\ No newline at end of file
isStoreProduct
=
true
\ No newline at end of file
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