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
eeddb878
Commit
eeddb878
authored
Jul 07, 2022
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
133エラーで10回リトライ機能を削除した。
parent
d33d58a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BleManagerUtil.java
+16
-12
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BleManagerUtil.java
View file @
eeddb878
...
...
@@ -67,17 +67,17 @@ public class BleManagerUtil {
// デバイスと離れて応答がなく、タイムアウトになる場合:8
// デバイスと接続が切れた場合のメッセージコード:19
if
(
status
==
133
||
status
==
62
||
status
==
8
||
status
==
19
)
{
// 接続失敗
if
(
status
==
133
)
{
if
(
retryCount
<
RETRY_MAX
)
{
retryCount
++;
new
Handler
(
Looper
.
getMainLooper
()).
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
mBluetoothGatt
=
mDevice
.
connectGatt
(
mContext
,
false
,
mGattcallback
,
TRANSPORT_LE
);
}
},
1500
);
}
}
//
if (status == 133) {
//
if (retryCount < RETRY_MAX) {
//
retryCount++;
//
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
//
@Override
//
public void run() {
//
mBluetoothGatt = mDevice.connectGatt(mContext, false, mGattcallback, TRANSPORT_LE);
//
}
//
}, 1500);
//
}
//
}
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
@@ -87,6 +87,8 @@ public class BleManagerUtil {
Logger
.
e
(
TAG
,
"onConnectionStateChange status = "
+
status
);
}
});
gatt
.
disconnect
();
gatt
=
null
;
return
;
}
...
...
@@ -301,8 +303,10 @@ public class BleManagerUtil {
// 切断
public
void
disconnect
()
{
Logger
.
d
(
TAG
,
"disconnect"
);
if
(
mBluetoothGatt
==
null
)
{
Logger
.
d
(
TAG
,
"already gatt is null"
);
return
;
}
...
...
@@ -313,7 +317,7 @@ public class BleManagerUtil {
// ②「接続可能範囲から外れた切断」は、内部処理でmBluetoothGatt.disconnect()処理が実施される。
// 切断時のコールバックでmBluetoothGatt.connect()を呼んでおくと、接続可能範囲に入ったら自動接続する。
mBluetoothGatt
.
disconnect
();
mBluetoothGatt
.
close
();
//
mBluetoothGatt.close();
mBluetoothGatt
=
null
;
mListener
=
null
;
...
...
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