echel0n wrote on Wednesday, February 18, 2009:
Ok what I’m trying to do is send data from my uart to another task that will send it out via ethernet.
Problem is when I transfer the data and length variables it seems to only send and store one of the values.
Any idea’s on how I can accomplish or fix this code ?
Here’s some of the code I have so far:
typedef struct
{
long length;
signed char *data;
} xIKSMessage;
// Task 1
/* The queue used to send data to the IKS task. */
xQueueHandle xIKSQueue;
void task1(void)
{
xIKSMessage xMessage;
xIKSQueue = xQueueCreate( 10, sizeof( struct xIKSMessage * ) );
// Wait for RX Data from receiver
while ((uart1in.length = uart1Read(uart1in.data)) == pdFALSE);
// Send data to IKS Server
xMessage.length = uart1in.length;
xMessage.data = uart1in.data;
/* Send the message to the LCD gatekeeper for display. */
xQueueSend( xIKSQueue, &xMessage, portMAX_DELAY );
}
// Task2
/* The queue used to send data to the IKS task. */
xQueueHandle xIKSQueue;
void iks_appcall(void)
{
xIKSMessage xData;
if( xIKSQueue != 0 )
{
// Receive a message on the created queue. Block for 10 ticks if a
// message is not immediately available.
if( xQueueReceive( xIKSQueue, &xData, ( portTickType ) 10 ) )
{
if(uip_connected() || uip_rexmit())
{
uip_send(xData.data, xData.length);
iks_datasent = 1;
}
}
}
}