consistent log_debug output between qnmodem and qngateway

pull/12/head
Tom Early 7 years ago
parent e9293858e2
commit fa59fa5990

@ -1097,8 +1097,8 @@ void CQnetGateway::ProcessG2(const ssize_t g2buflen, const SDSVT &g2buf, const b
const unsigned int ctrl = g2buf.ctrl & 0x3FU;
const unsigned char sync_data[3] = { 0x55U, 0x2DU, 0x16U };
if (memcmp(sync_data, g2buf.vasd.text, 3U)) {
const char *ch = "!ABCDEFGHIJKLMNOPQRSTUVWXYZ";
superframe[i].append(1, (ctrl<27U) ? ch[ctrl] : '*' );
const char *ch = "!1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
superframe[i].append(1, (ctrl<37U) ? ch[ctrl] : '*' );
} else {
const char *ch = "#abcdefghijklmnopqrstuvwxyz";
superframe[i].append(1, (ctrl<27U) ? ch[ctrl] : '%' );

@ -622,16 +622,17 @@ bool CQnetModem::ProcessGateway(const int len, const unsigned char *raw)
frame.type = TYPE_DATA;
memcpy(frame.voice.ambe, dsvt.vasd.voice, 12);
if (LOG_DEBUG) {
const unsigned int ctrl = dsvt.ctrl & 0x3FU;
if (VoicePacketIsSync(dsvt.vasd.text)) {
if (superframe.size() > 65) {
printf("Frame order: %s\n", superframe.c_str());
superframe.clear();
}
superframe.append(1, '#');
const char *ch = "#abcdefghijklmnopqrstuvwxyz";
superframe.append(1, (ctrl<27U) ? ch[ctrl] : '%');
} else {
const char *ch = "!ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
const unsigned int ctrl = dsvt.ctrl & 0x3FU;
superframe.append(1, (ctrl<53U) ? ch[ctrl] : '*');
const char *ch = "!1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
superframe.append(1, (ctrl<37U) ? ch[ctrl] : '*');
}
}
}
@ -718,8 +719,7 @@ bool CQnetModem::ProcessModem(const SMODEM &frame)
}
if (nextctrl > 20U) {
if (LOG_DEBUG)
printf("Warning: nextctrl=%u, inserting missing sync frame\n", nextctrl);
fprintf(stderr, "Warning: nextctrl=%u, inserting missing sync frame\n", nextctrl);
dsvt.ctrl = 0U;
memcpy(dsvt.vasd.voice, sync, 12U);
Modem2Gate.Write(dsvt.title, 27);

Loading…
Cancel
Save

Powered by TurnKey Linux.