var str =Integer.toHexString(progress) // orderArr[3] = progress.toByte() //错误的写法 orderArr[3] = str.toInt(16).toByte() msg.text = if(str.length > 1) "0x$str" else "0x0$str"