VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
socket/datagram.h
Go to the documentation of this file.
1#pragma once
2
4#include "../socket.h"
7#include <stdint.h>
8
9#define VLCB_NET_SOCK_DGRAM_BUF(name, size) \
10 uint8_t \
11 name##_data[sizeof(VlcbPacketBuf) + sizeof(VlcbPacketDatagram) * size]; \
12 vlcb_net_packetbuf_Init(name##_data, size, sizeof(VlcbPacketDatagram)); \
13 VlcbPacketBuf *const name = (VlcbPacketBuf *const)name##_data;
14
15typedef struct {
16 _INTERFACE_IMPLEMENT(IVlcbNetSocket);
20
22 VlcbPacketBuf *const txBuf);
23
30
37
40 const VlcbNetPacketDatagram *const packet);
43 VlcbNetPacketDatagram *const packet);
44
45static inline IVlcbNetSocket *const
47 return (IVlcbNetSocket *)sock;
48}
49
56
const char *const vlcb_error
Definition error.h:3
VlcbNetSocketDgramRecvErr vlcb_net_sock_dgram_Recv(VlcbNetSocketDatagram *const sock, VlcbNetPacketDatagram *const packet)
VlcbNetSocketDgramSendErr
@ VLCB_NET_SOKC_DGRAM_SEND_ERR_COUNT
@ VLCB_NET_SOCK_DGRAM_SEND_ERR_OK
@ VLCB_NET_SOCK_DGRAM_SEND_ERR_BUF_FULL
vlcb_error vlcb_net_sock_dgram_SendErrToStr(VlcbNetSocketDgramSendErr err)
VlcbNetSocketDatagram vlcb_net_sock_dgram_New(VlcbPacketBuf *const rxBuf, VlcbPacketBuf *const txBuf)
VlcbNetSocketDgramSendErr vlcb_net_sock_dgram_Send(VlcbNetSocketDatagram *const sock, const VlcbNetPacketDatagram *const packet)
VlcbNetSocketDgramRecvErr
@ VLCB_NET_SOKC_DGRAM_RECV_ERR_COUNT
@ VLCB_NET_SOCK_DGRAM_RECV_ERR_WOULD_BLOCK
@ VLCB_NET_SOCK_DGRAM_RECV_ERR_OK
static IVlcbNetSocket *const vlcb_net_sock_dgram_Upcast(VlcbNetSocketDatagram *const sock)
VlcbNetSockDgramFlushMode
@ VLCB_NET_SOCK_DGRAM_FLUSH_RX
@ VLCB_NET_SOCK_DGRAM_FLUSH_TX
@ VLCB_NET_SOCK_DGRAM_FLUSH_BOTH
void vlcb_net_sock_dgram_Flush(VlcbNetSocketDatagram *const sock, const VlcbNetSockDgramFlushMode mode)
VlcbPacketBuf *const txBuf
VlcbPacketBuf *const rxBuf
_INTERFACE_IMPLEMENT(IVlcbNetSocket)