lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] memcpying p->payload?


From: girrian seedo
Subject: [lwip-users] memcpying p->payload?
Date: Fri, 24 Aug 2012 09:14:47 +0300

Hi everyone!

I had a problem when I was trying to memcpy p->payload directly into a systems memory. I tried to do it as below.

memcpy
(
(unsigned int *)(SYSTEM_MEMORY + 4*size),\
(unsigned int *)(p->payload+PACKET_HEADER),
bytesReceived-PACKET_HEADER
);

This didn't work at all, and my packets data part didn't get copied. Then I tried to do it as follows.

char *receiveBuffer = malloc(sizeof(char) * DATA_PART); 
if(receiveBuffer == NULL){
xil_printf("out of memory\n");
}

memcpy(receiveBuffer, p->payload+PACKET_HEADER, bytesReceived-PACKET_HEADER);
    
And now from *packet I'm able to copy it into my systems memory address.

memcpy
(
(unsigned int *)(WARPLAB_TXBUFF_RADIO1 + 4*rxArgs0),\
(unsigned int *)(receiveBuffer),
bytesReceived-PACKET_HEADER
);
Any reason why I wasn't able to copy it directly from p->payload?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]