Fixed length and zero payload bug

This commit is contained in:
adrcs 2025-02-05 20:24:56 -07:00 committed by GitHub
parent e3081e7995
commit eb18a3f06b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 26 deletions

View file

@ -206,8 +206,12 @@ BOOL Chat_Task_exec(void)
strncpy(dest_call, keyBuffer, cpyLen);
destEnt = FALSE;
} else {
if(keyPos != 0) {
keyBuffer[keyPos++] = '\0';
sendLine(keyBuffer, keyPos);
} else {
USART_Print_string(">>>not sent\r\n");
}
}
keyPos = 0;
break;
@ -238,7 +242,7 @@ BOOL Chat_Task_exec(void)
// send a line of text
void sendLine(char *buffer, int len)
{
SendTextFrame(setup_memory.params.setup_data.stnCall, TEXT_TYPE, dest_call, TEXT_TYPE, buffer, len, repeat);
SendTextFrame(setup_memory.params.setup_data.stnCall, TEXT_TYPE, dest_call, TEXT_TYPE, buffer, len, repeat);
}
/*
@ -280,7 +284,7 @@ void PrintFrame(IP400_FRAME *FrameBytes)
USART_Print_string("[%d:%04d]:", FrameBytes->flagfld.flags.hop_count, FrameBytes->seqNum);
// now dump the data
memcpy(printBuf, FrameBytes->buf, dataLen);
memcpy(printBuf, FrameBytes->buf, dataLen+3);
printBuf[dataLen] = '\0';
USART_Print_string("%s\r\n", printBuf);

View file

@ -242,16 +242,6 @@ void RepeatFrame(IP400_FRAME *frame)
*/
void QueueTxFrame(IP400_FRAME *txframe)
{
/*
FRAME_QUEUE *f;
if((f = malloc(sizeof(FRAME_QUEUE))) == NULL)
return;
// set the frame buffer and sequence number
f->frame = txframe;
insque((QUEUE_ELEM *)f, (QUEUE_ELEM *)txQueue.q_back);
*/
enqueFrame(&txQueue, txframe);
}
@ -284,20 +274,6 @@ void Frame_Txtask_exec(void)
// idle: waiting for work
case TX_IDLE:
/*
// wait for a frame to send
if(txQueue.q_back == &txQueue)
return;
// get a frane from the top of the queue
FRAME_QUEUE *f = txQueue.q_forw;
remque((struct qelem *)f);
// this would be better as a union..
int frameLen = f->length;
tFrame = f->frame;
*/
tFrame = dequeFrame(&txQueue);
uint8_t *rawFrame = (uint8_t *)rawTxFrame;