10 struct BAP_Frame* vw_bap_frame_alloc(void)
12 struct BAP_Frame* bap_frame;
14 bap_frame = calloc(1, sizeof(struct BAP_Frame));
20 void vw_bap_frame_free(struct BAP_Frame *bap_frame)
26 int vw_bap_frame_is_valid(struct BAP_Frame *bap_frame)
29 || (bap_frame->opcode > 7)
30 || (bap_frame->node > 63)
31 || (bap_frame->function > 63)
32 || (bap_frame->len > 4095)
33 || (!bap_frame->is_multiframe && bap_frame->len > 6)
42 void vw_bap_frame_dump(struct BAP_Frame *bap_frame)
46 printf("%u. %2i/%-2i .%02i --",
52 for (i = 0; i < bap_frame->len; i++) {
56 printf("%02x", (unsigned char)(bap_frame->data[i]));
60 for (i = 0; i < bap_frame->len; i++) {
61 unsigned char c = bap_frame->data[i];
62 if (!isprint(c) || c == '\n' || c == '\r') {