From c912b0f1d3994cde07d472e2c53f0375518a74df Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 13 Jan 2014 05:08:51 -0600 Subject: Add serial console server --- .../src/logic_analyzer_server.cpp | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'servers/logic_analyzer_server_lin/src/logic_analyzer_server.cpp') diff --git a/servers/logic_analyzer_server_lin/src/logic_analyzer_server.cpp b/servers/logic_analyzer_server_lin/src/logic_analyzer_server.cpp index 1e846d5..a0f764c 100644 --- a/servers/logic_analyzer_server_lin/src/logic_analyzer_server.cpp +++ b/servers/logic_analyzer_server_lin/src/logic_analyzer_server.cpp @@ -234,36 +234,36 @@ void LogicAnalyzerSocket::commandLoop() { } writeEndOfFrame(); } - } - else if (instrumentCommand == "GETTRACESAMPLECOUNT") { // Want to get number of samples in a trace - TQ_INT32 samples = gpmc_sample_count(); - if (samples > 0) { - ds << TQString("ACK"); - ds << samples; - writeEndOfFrame(); - } - else { - ds << TQString("NCK"); - writeEndOfFrame(); + else if (instrumentCommand == "GETTRACESAMPLECOUNT") { // Want to get number of samples in a trace + TQ_INT32 samples = gpmc_sample_count(); + if (samples > 0) { + ds << TQString("ACK"); + ds << samples; + writeEndOfFrame(); + } + else { + ds << TQString("NCK"); + writeEndOfFrame(); + } } - } - else if (instrumentCommand == "GETNUMBEROFCHANNELS") { // Want the number of channels available - TQ_INT32 channels = gpmc_channel_count(); - if (channels > 0) { - ds << TQString("ACK"); - ds << channels; - writeEndOfFrame(); + else if (instrumentCommand == "GETNUMBEROFCHANNELS") { // Want the number of channels available + TQ_INT32 channels = gpmc_channel_count(); + if (channels > 0) { + ds << TQString("ACK"); + ds << channels; + writeEndOfFrame(); + } + else { + ds << TQString("NCK"); + writeEndOfFrame(); + } } else { + printf("[WARNING] Received unknown command %s from host %s\n\r", instrumentCommand.ascii(), m_remoteHost.ascii()); fflush(stdout); ds << TQString("NCK"); writeEndOfFrame(); } } - else { - printf("[WARNING] Received unknown command %s from host %s\n\r", instrumentCommand.ascii(), m_remoteHost.ascii()); fflush(stdout); - ds << TQString("NCK"); - writeEndOfFrame(); - } transferred_data = true; } -- cgit v1.2.3