![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
rtpbuf.cpp
- Committer:
- klauss
- Date:
- 2015-04-30
- Revision:
- 119:ee6a53069455
- Parent:
- 74:81c47fff88a5
- Child:
- 121:ee02790d00b7
File content as of revision 119:ee6a53069455:
#include <stdlib.h> #include "rtpbuf.h" void rtpbuf_clear (rtpbuf_t * self) { self->size = 0; } void rtpbuf_put (rtpbuf_t * self, int size, uint8_t * data){ if ((size + self->size) <= RTPBUF_BUFSIZE){ xmemcpy((uint8_t*)self->b+self->size,data,size); self->size += size; } } uint8_t * rtpbuf_get (rtpbuf_t * self) { if (self->size < RTPBUF_PKGSIZE) { return NULL; } return (uint8_t*) self->b; } void rtpbuf_next (rtpbuf_t * self) { if (self->size >= RTPBUF_PKGSIZE){ self->size -= RTPBUF_PKGSIZE; if (self->size > 0) { xmemcpy32(self->b, (self->b)+(RTPBUF_PKGSIZE>>2), self->size); } } }