diff --git a/QnetGateway.cpp b/QnetGateway.cpp index ec5a764..22a631a 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -996,9 +996,6 @@ void CQnetGateway::ProcessIncomingSD(const SDSVT &dsvt) if (sd.size > 5) { printf("got a size of %d\n", sd.size); sd.size = 5; - } else if (sd.size < 0) { - printf("got a size of %d\n", sd.size); - sd.size = 0; } int size = sd.size; if (size > 2) @@ -1071,6 +1068,10 @@ void CQnetGateway::ProcessIncomingSD(const SDSVT &dsvt) sd.ig = 0; } else { sd.ig += sd.size; + sd.gps[sd.ig] = 0; + for (int j=0; sd.gps[j]; j++) + printf("%c", sd.gps[j]); + printf("\n"); } break; case 0x40U: // message diff --git a/QnetGateway.h b/QnetGateway.h index 161d7e1..829967a 100644 --- a/QnetGateway.h +++ b/QnetGateway.h @@ -81,12 +81,12 @@ using SBANDTXT = struct band_txt_tag { using SSD = struct sd_tag { unsigned char header[41]; - char message[21]; - char gps[256]; - int ih, im, ig; + unsigned char message[21]; + unsigned char gps[256]; + unsigned int ih, im, ig; unsigned char type; bool first; - int size; + unsigned int size; void Init() { ih = im = ig = 0; first = true; } };