mirror of
https://github.com/adrcs/ip400.git
synced 2025-04-21 11:13:42 +03:00
Fixed length and zero payload bug
This commit is contained in:
parent
e3081e7995
commit
eb18a3f06b
|
@ -206,8 +206,12 @@ BOOL Chat_Task_exec(void)
|
||||||
strncpy(dest_call, keyBuffer, cpyLen);
|
strncpy(dest_call, keyBuffer, cpyLen);
|
||||||
destEnt = FALSE;
|
destEnt = FALSE;
|
||||||
} else {
|
} else {
|
||||||
|
if(keyPos != 0) {
|
||||||
keyBuffer[keyPos++] = '\0';
|
keyBuffer[keyPos++] = '\0';
|
||||||
sendLine(keyBuffer, keyPos);
|
sendLine(keyBuffer, keyPos);
|
||||||
|
} else {
|
||||||
|
USART_Print_string(">>>not sent\r\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
keyPos = 0;
|
keyPos = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -280,7 +284,7 @@ void PrintFrame(IP400_FRAME *FrameBytes)
|
||||||
USART_Print_string("[%d:%04d]:", FrameBytes->flagfld.flags.hop_count, FrameBytes->seqNum);
|
USART_Print_string("[%d:%04d]:", FrameBytes->flagfld.flags.hop_count, FrameBytes->seqNum);
|
||||||
|
|
||||||
// now dump the data
|
// now dump the data
|
||||||
memcpy(printBuf, FrameBytes->buf, dataLen);
|
memcpy(printBuf, FrameBytes->buf, dataLen+3);
|
||||||
printBuf[dataLen] = '\0';
|
printBuf[dataLen] = '\0';
|
||||||
USART_Print_string("%s\r\n", printBuf);
|
USART_Print_string("%s\r\n", printBuf);
|
||||||
|
|
||||||
|
|
|
@ -242,16 +242,6 @@ void RepeatFrame(IP400_FRAME *frame)
|
||||||
*/
|
*/
|
||||||
void QueueTxFrame(IP400_FRAME *txframe)
|
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);
|
enqueFrame(&txQueue, txframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,20 +274,6 @@ void Frame_Txtask_exec(void)
|
||||||
// idle: waiting for work
|
// idle: waiting for work
|
||||||
case TX_IDLE:
|
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);
|
tFrame = dequeFrame(&txQueue);
|
||||||
uint8_t *rawFrame = (uint8_t *)rawTxFrame;
|
uint8_t *rawFrame = (uint8_t *)rawTxFrame;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue