Commit 8ff876717259f5156ac23d9e472de31c65ad3f02

Authored by 芯火源
1 parent 49768981

refactor: 设备收到指令乱码问题修复。

@@ -278,8 +278,8 @@ public class ByteUtils { @@ -278,8 +278,8 @@ public class ByteUtils {
278 return result; 278 return result;
279 } 279 }
280 280
281 - public static byte[] strToBytes(String str) {  
282 - if (Pattern.compile(messageRegular).matcher(str).matches()) { 281 + public static byte[] strToBytes(String str){
  282 + if(Pattern.compile("^[A-Fa-f0-9]+$").matcher(str).matches()){
283 return hexStr2Bytes(str); 283 return hexStr2Bytes(str);
284 } 284 }
285 return getBytes(str, ByteUtils.UTF_8); 285 return getBytes(str, ByteUtils.UTF_8);