QueueList library trouble with classes

Hello. I'm from Argentina and I'm new at this forum.

I'm having troubles in a project I'm developing. They're about the QueueList library (Arduino Playground - QueueList Library).

I created a class named "paquete_llc" (I don't copy here the function definitions):

class paquete_llc
{
	public:
		byte origen;
		byte destino;
		tipo_de_paquetes_llc_t tipoDePaquete;
		byte numeroDeSecuencia;
		byte longitud;
		byte datos[MAX_LONG_DATOS];
		byte crc;
		
		int retransmisiones;
	
		// Constructor
		paquete_llc(void);
		paquete_llc(byte pOrigen, byte pDestino, tipo_de_paquetes_llc_t pTipoDePaquete, byte pNumeroDeSecuencia, byte* pDatos, int LongitudDatos);
	
		boolean parsear(byte *paquete);
		
		boolean enviar(void);
		
		byte crc8(byte *addr, int len);
};

In the main code I create QueueList objects of this class type in this way:

QueueList <paquete_llc> llc_tx_queue;

The problem is: I enqueue an element. Later, when I dequeue it, it doesn't match the element I had enqueue.
Could it be because I use a class name as the type of element in the queues?

Thanks for your help!

I've been researching and realized that the QueueList library uses "malloc" and "free" instead of "new" and "delete". There are people that think this is so wrong in C++. And I'm using classes, so...

By the way, I tried to fix the problem replacing "malloc" into "new" and "free" into "delete", but it doesn't solve the problem, because it brings more compilation errors than solutions...

Suggestions?

I think you should post the entire code or at least a simple example that shows the problem you are describing. This would help other people help you :slight_smile: