功能优化,增加心跳数据处理

This commit is contained in:
2025-08-07 11:07:04 +08:00
parent 005e7eae53
commit c409621e28
5 changed files with 92 additions and 44 deletions
@@ -104,8 +104,11 @@ class ShelfActivity : BaseActivity() {
binding.btnClearZero.setOnClickListener { v ->
lifecycleScope.launch {
val shelfNo = shelfModel?.shelfNo ?: 0
val hex = shelfNo.toString(16).padStart(2, '0').uppercase()
Log.d(TAG, "onCreate: hex=$hex")
val zeroClearingCmd =
"${HomeActivity.HEADER}0401${decToHex(shelfNo)}${HomeActivity.FOOTER}"
"${HomeActivity.HEADER}0401${hex}${HomeActivity.FOOTER}"
Log.d(TAG, "onCreate: zeroClearingCmd=$zeroClearingCmd")
SerialPortManager.send(zeroClearingCmd)
}
KeyboardUtil.hideKeyboard(v.context, v)