Hello,
I need to copy pBuf to another pBuf member, and I need to change size of the new buffer to be 1 larger than the previous one.
I am doing like these,
mpBuf = pbuf_alloc(PBUF_RAW, p->len + (p->next? p->next->tot_len: 0) + 1, PBUF_POOL);
mpBuf->len = p->len + 1;
mpBuf->tot_len = mpBuf->tot_len + 1;
for(i = 0; i < (p->len) ; i++)
{
((uint8_t*)mpBuf->payload)[dummyCounter] = ((uint8_t*)p->payload)[dummyCounter];
}
But I couldnt sure, successfully copied. What is the correct way ?
--