| | |
| | | + (byte) ((b >> 1) & 0x1) + (byte) ((b >> 0) & 0x1); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 音乐命令变成byte数组 |
| | | * @param commandString |
| | | * @return |
| | | */ |
| | | public static byte [] GetMusicBytes (String commandString){ |
| | | byte [] bytes = new byte[0]; |
| | | try { |
| | | bytes = commandString.getBytes("US-ASCII"); |
| | | byte [] sendBytes = new byte [bytes.length + 1]; |
| | | sendBytes [bytes.length] = 0x0D; |
| | | System.arraycopy (bytes, 0, sendBytes, 0, bytes.length); |
| | | return sendBytes; |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | return bytes; |
| | | } |
| | | } |
| | | |
| | | |
| | | // private byte[] formatStyleHDLResponse(String responsePart1, String responsePart2, int maxLen) throws UnsupportedEncodingException { |