Skip to content

Commit de4c7ec

Browse files
committed
revert 修复截取mac名称发生的崩溃
1 parent 60cfa68 commit de4c7ec

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,8 @@ class BleConfigService private constructor() {
170170
dev?.devName = result?.scanRecord?.deviceName.toString()
171171
dev?.showedName = result?.scanRecord?.deviceName.toString()
172172
if (!dev?.showedName?.contains("-")!! && !dev?.showedName?.contains("_")!!) {
173-
var interceptMacName: String? = ""
174-
if (dev?.mac?.isNotEmpty() == true) {
175-
val macEndIndex =
176-
if (dev?.mac?.length!! > 4) 4 else dev?.mac!!.length - 1
177-
interceptMacName =
178-
dev?.mac?.substring(0, macEndIndex)?.toUpperCase()
179-
}
180-
dev?.showedName = "${dev?.showedName}_${interceptMacName ?: ""}"
173+
dev?.showedName = "${dev?.showedName}_${dev?.mac?.substring(0, 4)?.toUpperCase()}"
174+
181175
}
182176
break
183177
} else if (value.uuid.toString().substring(4, 8).toUpperCase().equals("FFE0")) {

0 commit comments

Comments
 (0)