/** Sends a command by breaking it into entries and sending each entry. */ private void sendCommand(BaseCommand<?> command, int maxSendAttempts) { for (Entry entry : EntryDispatcher.toEntries(command)) sendEntry(entry, maxSendAttempts); }
/** Reads input from the device and dispatches the result to the command listener. */ private void processInputData() throws IOException { out.write(Protocol.PC_READY.value); out.flush(); InputBuffer buffer = InputBuffer.readFrom(in); dispatcher.dispatch(buffer.entries); }