In freertos documentation they say that There are two ways in which queue behavior could have been implemented:
Queue by copy : Queuing by copy means the data sent to the queue is copied byte for byte into the queue.
Queue by reference : Queuing by reference means the queue only holds pointers to the data sent to the queue, not the data itself.
My question is in the code bellow when i send the struct "CommandData" from task1 to task2 and then change the DataArray field in the struct in the receiving task.does this affect the same field in the sending task.
In other word in this case is it Queuing by copy or Queuing by reference?
typedef struct
{
uint8_t * ArrayLength;
uint8_t * DataArray;
}
FunctionStruct;
bool Read(uint8_t * Length, uint8_t * AttributeData)
{
FunctionStruct CommandData;
....
__t_CommandData.ArrayLength = Length;
__t_CommandData.DataArray = AttributeData;
....
xQueueSendToBack(x_Queue, &CommandData, 0U)
.....
}
thank you