Skip to content

Commit 338bb8f

Browse files
committed
修改搜索到的蓝牙设备显示名称-集贤
Change-Id: Ie3b9bec72dbd4f710bfcbacfedeffc9f2a2694f8
1 parent 3a6f79f commit 338bb8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/explorer-link-android/src/main/java/com/tencent/iot/explorer/link/core/link/service/BleConfigService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class BleConfigService private constructor() {
172172
}
173173
dev?.devName = result?.scanRecord?.deviceName.toString()
174174
dev?.showedName = result?.scanRecord?.deviceName.toString()
175-
if (!dev?.showedName?.contains("-")!!) {
175+
if (!dev?.showedName?.contains("-")!! && !dev?.showedName?.contains("_")!!) {
176176
dev?.showedName = "${dev?.showedName}_${dev?.mac?.substring(0, 4)?.toUpperCase()}"
177177

178178
}
@@ -231,7 +231,7 @@ class BleConfigService private constructor() {
231231
dev?.mac = it
232232
}
233233
dev?.showedName = result?.scanRecord?.deviceName.toString()
234-
if (!dev.showedName.contains("-")) {
234+
if (!dev.showedName.contains("-") && !dev.showedName.contains("_")) {
235235
dev.showedName = "${dev.showedName}_${dev.mac.substring(0, 4).toUpperCase()}"
236236
}
237237
}

0 commit comments

Comments
 (0)