VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
vlcb.c
Go to the documentation of this file.
2
3#include <assert.h>
4#include <stdbool.h>
5
7 switch (opc) {
10 default:
12 }
13}
14
16 assert(err > VLCB_NET_PKT_CONSTRUCT_ERR_OK &&
18
19 switch (err) {
21 return "vlcb payload too large";
23 return "vlcb invalid opcode";
24 }
25 assert(false /* unhandled case guard */);
26}
27
29 uint8_t payload_len,
30 const VlcbNetPayload *const payload,
31 VlcbNetPacket *const packet) {
32 // TODO: implement
33}
34
36 const VlcbNetPayload *const payload,
37 VlcbNetPacket *const packet) {
38 // TODO: implement
40}
const char *const vlcb_error
Definition error.h:3
VlcbNetProtocol vlcb_net_pkt_DetectProtocol(VlcbOpCode opc)
Definition vlcb.c:6
vlcb_error vlcb_net_pkt_ConstructErrToStr(VlcbNetPacketConstructErr err)
Definition vlcb.c:15
VlcbNetPacketConstructErr vlcb_net_pkt_New(VlcbOpCode opc, uint8_t payload_len, const VlcbNetPayload *const payload, VlcbNetPacket *const packet)
Definition vlcb.c:35
void vlcb_net_pkt_NewUnchecked(VlcbNetProtocol proto, VlcbOpCode opc, uint8_t payload_len, const VlcbNetPayload *const payload, VlcbNetPacket *const packet)
Definition vlcb.c:28
uint8_t VlcbNetPayload[7]
Definition vlcb.h:17
VlcbNetProtocol
Definition vlcb.h:26
@ VLCB_NET_PROTO_DATAGRAM
Definition vlcb.h:27
@ VLCB_NET_PROTO_STREAM
Definition vlcb.h:28
VlcbNetPacketConstructErr
Definition vlcb.h:40
@ VLCB_NET_PKT_CONSTRUCT_ERR_OK
Definition vlcb.h:41
@ VLCB_NET_PKT_CONSTRUCT_ERR_COUNT
Definition vlcb.h:59
@ VLCB_NET_PKT_CONSTRUCT_ERR_INVALID_OPCODE
Definition vlcb.h:53
@ VLCB_NET_PKT_CONSTRUCT_ERR_PAYLOAD_TOO_LARGE
Definition vlcb.h:48
VlcbOpCode
Definition vlcb_defs.h:493
@ VLCB_OPC_STREAM_PACKET
Definition vlcb_defs.h:1702