Skip to content

Commit

Permalink
revert 修复截取mac名称发生的崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
neilyhe committed Jun 19, 2024
1 parent 457719a commit 98ae005
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,8 @@ class BleConfigService private constructor() {
dev?.devName = result?.scanRecord?.deviceName.toString()
dev?.showedName = result?.scanRecord?.deviceName.toString()
if (!dev?.showedName?.contains("-")!! && !dev?.showedName?.contains("_")!!) {
var interceptMacName: String? = ""
if (dev?.mac?.isNotEmpty() == true) {
val macEndIndex =
if (dev?.mac?.length!! > 4) 4 else dev?.mac!!.length - 1
interceptMacName =
dev?.mac?.substring(0, macEndIndex)?.toUpperCase()
}
dev?.showedName = "${dev?.showedName}_${interceptMacName ?: ""}"
dev?.showedName = "${dev?.showedName}_${dev?.mac?.substring(0, 4)?.toUpperCase()}"

}
break
} else if (value.uuid.toString().substring(4, 8).toUpperCase().equals("FFE0")) {
Expand Down

0 comments on commit 98ae005

Please sign in to comment.