TS SD integration #1653

This commit is contained in:
rusefi 2020-07-31 22:44:20 -04:00
parent 185a023ada
commit afe56a64c8
2 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,10 @@ public class BinaryProtocol implements BinaryProtocolCommands {
public static String findCommand(byte command) {
switch (command) {
case Fields.TS_SD_R_COMMAND:
return "SD_R_COMMAND";
case Fields.TS_SD_W_COMMAND:
return "SD_W_COMMAND";
case Fields.TS_PAGE_COMMAND:
return "PAGE";
case Fields.TS_COMMAND_F:

View File

@ -53,6 +53,8 @@ public interface IoStream extends WriteStream, Closeable, StreamStatistics {
}
default void sendPacket(byte[] plainPacket) throws IOException {
if (plainPacket.length == 0)
throw new IllegalArgumentException("Empty packets are not valid.");
byte[] packet;
if (BinaryProtocol.PLAIN_PROTOCOL) {
packet = plainPacket;