Implemented sendCommand.