From 752a2e8bcf75a2c080aac32a7474831855abcb2f Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Wed, 20 May 2026 12:33:15 +0200 Subject: [PATCH] nwconn hex57 detial debug sun 3 & 6 --- src/nwconn.c | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/nwconn.c b/src/nwconn.c index a19600d..9875146 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -152,14 +152,14 @@ static int ncp_response(int sequence, int task, int sub2 = (requestlen > 1) ? requestdata[1] : -1; int sub3 = (requestlen > 2) ? requestdata[2] : -1; XDPRINTF((2,0, - "NS57 RESP compl=0x%x data_len=%d seq=%d task=%d sub1=0x%02x sub2=0x%02x sub3=0x%02x", - (int)completition, - data_len, - (int)sequence, - (int)task, - sub1 & 0xff, - sub2 & 0xff, - sub3 & 0xff)); + "NS57F RESP compl=0x%x data_len=%d seq=%d task=%d sub1=0x%02x sub2=0x%02x sub3=0x%02x", + (int)completition, data_len, (int)sequence, (int)task, + sub1 & 0xff, sub2 & 0xff, sub3 & 0xff)); + if (sub1 == 0x03 || sub1 == 0x06) { + XDPRINTF((2,0, + "NS57F TARGET RESP sub1=0x%02x compl=0x%x data_len=%d", + sub1 & 0xff, (int)completition, data_len)); + } } ud.udata.len = ud.udata.maxlen = sizeof(NCPRESPONSE) + data_len; if (t_sndudata(FD_NCP_OUT, &ud) < 0){ @@ -206,7 +206,7 @@ static int call_nwbind(int mode) } -static void debug_ns57_request(uint8 *data, int len) +static void debug_ns57_request_focus(uint8 *data, int len) { int sub1 = (len > 0) ? data[0] : -1; int sub2 = (len > 1) ? data[1] : -1; @@ -214,8 +214,8 @@ static void debug_ns57_request(uint8 *data, int len) char ascii[260]; int i, shown = len; - if (shown > 160) - shown = 160; + if (shown > 180) + shown = 180; if (shown < 0) shown = 0; @@ -226,29 +226,30 @@ static void debug_ns57_request(uint8 *data, int len) ascii[(shown < (int)sizeof(ascii) - 1) ? shown : ((int)sizeof(ascii) - 1)] = '\0'; XDPRINTF((2,0, - "NS57 ENTER len=%d sub1=0x%02x sub2=0x%02x sub3=0x%02x task=%d ascii='%s'", - len, - sub1 & 0xff, - sub2 & 0xff, - sub3 & 0xff, - (int)ncprequest->task, - ascii)); + "NS57F ENTER len=%d sub1=0x%02x sub2=0x%02x sub3=0x%02x task=%d ascii='%s'", + len, sub1 & 0xff, sub2 & 0xff, sub3 & 0xff, + (int)ncprequest->task, ascii)); if (data && len > 0) { int j = len; uint8 *p = data; - XDPRINTF((2, 2, "NS57 HEX len %d, DATA:", j)); + XDPRINTF((2,2,"NS57F HEX len %d, DATA:", j)); while (j--) { int c = *p++; if (c > 32 && c < 127) - XDPRINTF((2, 3, ",\'%c\'", (char)c)); + XDPRINTF((2,3,",\'%c\'", (char)c)); else - XDPRINTF((2, 3, ",0x%x", c)); + XDPRINTF((2,3,",0x%x", c)); } - XDPRINTF((2, 1, NULL)); + XDPRINTF((2,1,NULL)); + } + + if (sub1 == 0x03 || sub1 == 0x06) { + XDPRINTF((2,0, + "NS57F TARGET sub1=0x%02x len=%d maybe_open_or_lookup=1", + sub1 & 0xff, len)); } } - static void pr_debug_request() { if (req_printed++) return; @@ -367,7 +368,7 @@ static int handle_ncp_serv(void) if (nw_debug > 5) pr_debug_request(); if (function == 0x57) { - debug_ns57_request(requestdata, requestlen); + debug_ns57_request_focus(requestdata, requestlen); } if (ncp_type == 0x2222) {