Removed packetbuf references. This was a feature that is not used anymore and only made the code more complex.

This commit is contained in:
Adam Dunkels 2015-03-24 08:28:25 +01:00
parent c9c6688524
commit 7acf747c1a
14 changed files with 5 additions and 1130 deletions

View file

@ -106,10 +106,7 @@ packetbuf_compact(void)
{
int i, len;
if(packetbuf_is_reference()) {
memcpy(&packetbuf[PACKETBUF_HDR_SIZE], packetbuf_reference_ptr(),
packetbuf_datalen());
} else if(bufptr > 0) {
if(bufptr > 0) {
len = packetbuf_datalen() + PACKETBUF_HDR_SIZE;
for(i = PACKETBUF_HDR_SIZE; i < len; i++) {
packetbuf[i] = packetbuf[bufptr + i];
@ -215,26 +212,6 @@ packetbuf_hdrptr(void)
return (void *)(&packetbuf[hdrptr]);
}
/*---------------------------------------------------------------------------*/
void
packetbuf_reference(void *ptr, uint16_t len)
{
packetbuf_clear();
packetbufptr = ptr;
buflen = len;
}
/*---------------------------------------------------------------------------*/
int
packetbuf_is_reference(void)
{
return packetbufptr != &packetbuf[PACKETBUF_HDR_SIZE];
}
/*---------------------------------------------------------------------------*/
void *
packetbuf_reference_ptr(void)
{
return packetbufptr;
}
/*---------------------------------------------------------------------------*/
uint16_t
packetbuf_datalen(void)
{