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-11-24
- Revision:
- 137:32dd35a6dbc9
- Parent:
- 121:ee02790d00b7
File content as of revision 137:32dd35a6dbc9:
#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);
}
}
}
