xQueueReceive with structures

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;         }       }    } }

xQueueReceive with structures

You are defining your queue to hold a "struct xIKSMessage *", but are sending it a "struct xIKSMessage". Your queue should be sized to hold "struct xIKSMessage"

xQueueReceive with structures

Ok I was able to get it working fine but now I’m having issues with xQueueSend …. I’m trying to send a char array and it seems as if only the first byte gets sent and the rest of the data never makes it.

xQueueReceive with structures

The queque copies to internal queque structures the data you provide it as an input . So to send structures or tables, you should create queque that has elements size equal to of structure/table size NOT size of pointers to structure/table. When you attempt to send something, queue Send function copies the amount of bytes (usually) declared as element size during queue creation. It copies this amount of bytes from buffer pointer provided as Send function input argument. If you declared queue element of size of pointer, it will send only amount of bytes equal to pointer size in bytes each time you call Send function.