Reduce the level of network debugging output a little.

This commit is contained in:
Jonathan Naylor 2016-02-18 19:09:10 +00:00
parent f8d6d04306
commit e11be44f79
3 changed files with 26 additions and 8 deletions

View file

@ -255,6 +255,9 @@ bool CDMRIPSC::write(const CDMRData& data)
data.getData(buffer + 20U);
if (m_debug)
CUtils::dump(1U, "IPSC Transmitted", buffer, HOMEBREW_DATA_PACKET_LENGTH);
return write(buffer, HOMEBREW_DATA_PACKET_LENGTH);
}
@ -276,12 +279,15 @@ void CDMRIPSC::clock(unsigned int ms)
unsigned int port;
int length = m_socket.read(m_buffer, BUFFER_LENGTH, address, port);
if (m_debug && length > 0)
CUtils::dump(1U, "IPSC Received", m_buffer, length);
// if (m_debug && length > 0)
// CUtils::dump(1U, "IPSC Received", m_buffer, length);
if (length > 0 && m_address.s_addr == address.s_addr && m_port == port) {
if (::memcmp(m_buffer, "DMRD", 4U) == 0) {
if (m_enabled) {
if (m_debug)
CUtils::dump(1U, "IPSC Received", m_buffer, length);
unsigned char len = length;
m_rxData.addData(&len, 1U);
m_rxData.addData(m_buffer, len);
@ -452,8 +458,8 @@ bool CDMRIPSC::write(const unsigned char* data, unsigned int length)
assert(data != NULL);
assert(length > 0U);
if (m_debug)
CUtils::dump(1U, "IPSC Transmitted", data, length);
// if (m_debug)
// CUtils::dump(1U, "IPSC Transmitted", data, length);
return m_socket.write(data, length, m_address, m_port);
}

View file

@ -162,8 +162,8 @@ bool CDStarNetwork::writePoll(const char* text)
// Include the nul at the end also
::memcpy(buffer + 5U, text, length + 1U);
if (m_debug)
CUtils::dump(1U, "D-Star Network Poll Sent", buffer, 6U + length);
// if (m_debug)
// CUtils::dump(1U, "D-Star Network Poll Sent", buffer, 6U + length);
return m_socket.write(buffer, 6U + length, m_address, m_port);
}

View file

@ -23,6 +23,18 @@
#include <cassert>
#include <cstring>
const unsigned char ROTATION_PORTRAIT_LEFT = 0U;
const unsigned char ROTATION_LANDSCAPE_UD = 1U;
const unsigned char ROTATION_PORTRAIT_RIGHT = 2U;
const unsigned char ROTATION_LANDSCAPE = 3U;
const unsigned char FONT_SMALL = 0U;
const unsigned char FONT_MEDIUM = 1U;
const unsigned char FONT_LARGE = 2U;
// x = 0 to 159, y = 0 to 127 - Landscape
// x = 0 to 127, y = 0 to 159 - Portrait
CTFTSerial::CTFTSerial(const std::string& port, unsigned int brightness) :
m_serial(port, SERIAL_9600),
m_brightness(brightness)
@ -42,9 +54,9 @@ bool CTFTSerial::open()
return false;
}
setRotation(3U);
setRotation(ROTATION_LANDSCAPE);
setFontSize(1U);
setFontSize(FONT_MEDIUM);
setBrightness(m_brightness);