VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
adapter.h File Reference
#include <inttypes.h>
#include <stdbool.h>
#include "vlcb/platform/error.h"
#include "vlcb/platform/interface.h"
#include "adapter/can/packet.h"
#include "vlcb/net/addr.h"
Include dependency graph for adapter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  VlcbNetAdptPktMeta
 
struct  VlcbNetAdptPkt
 
struct  VlcbNetAdptCaps
 

Macros

#define VLCB_NET_ADPT_MAX_PAYLOAD   8
 

Typedefs

typedef uint8_t VlcbNetAdptPayload[8]
 

Enumerations

enum  VlcbNetAdptErr {
  VLCB_NET_ADPT_ERR_OK = 0 , VLCB_NET_ADPT_ERR_WOULD_BLOCK , VLCB_NET_ADPT_ERR_UNSUPPORTED_MEDIUM , VLCB_NET_ADPT_ERR_PAYLOAD_TOO_LARGE ,
  VLCB_NET_ADPT_ERR_INVALID_CANID , VLCB_NET_ADPT_ERR_COUNT
}
 

Functions

vlcb_error vlcb_net_adpt_ErrToStr (VlcbNetAdptErr err)
 
 _INTERFACE_DECLARE (IVlcbNetAdpt, _INTERFACE_METHOD_DECLARE(VlcbNetAdptErr, RecvPkt, _INTERFACE_SELF_PTR_MUT(IVlcbNetAdpt), VlcbNetAdptPkt *const pkt);_INTERFACE_METHOD_DECLARE(VlcbNetAdptErr, SendPkt, _INTERFACE_SELF_PTR_MUT(IVlcbNetAdpt), const VlcbNetAdptPkt *const pkt);_INTERFACE_METHOD_DECLARE(VlcbNetAdptCaps, Caps, _INTERFACE_SELF_PTR(IVlcbNetAdpt));)
 

Macro Definition Documentation

◆ VLCB_NET_ADPT_MAX_PAYLOAD

#define VLCB_NET_ADPT_MAX_PAYLOAD   8

Definition at line 9 of file adapter.h.

Typedef Documentation

◆ VlcbNetAdptPayload

typedef uint8_t VlcbNetAdptPayload[8]

Definition at line 11 of file adapter.h.

Enumeration Type Documentation

◆ VlcbNetAdptErr

Enumerator
VLCB_NET_ADPT_ERR_OK 
VLCB_NET_ADPT_ERR_WOULD_BLOCK 

Device is busy or has nothing to transfer.

Not an error state, can be used by device drivers to signal that it cannot receive at the moment. The library will do other tasks instead of waiting to do them until next packet will get delivered.

It is advisable to use this non-blockking functionality.

VLCB_NET_ADPT_ERR_UNSUPPORTED_MEDIUM 

Passed in packet for transmission contains unsupported medium by this network device.

VLCB_NET_ADPT_ERR_PAYLOAD_TOO_LARGE 

Passed in payload had length that was above the limit that the device can transfer.

VLCB_NET_ADPT_ERR_INVALID_CANID 
VLCB_NET_ADPT_ERR_COUNT 

Not an actual error, can be used to ensure the returned codes are within valid range.

Definition at line 39 of file adapter.h.

Function Documentation

◆ _INTERFACE_DECLARE()

_INTERFACE_DECLARE ( IVlcbNetAdpt ,
_INTERFACE_METHOD_DECLARE(VlcbNetAdptErr, RecvPkt, _INTERFACE_SELF_PTR_MUT(IVlcbNetAdpt), VlcbNetAdptPkt *const pkt);_INTERFACE_METHOD_DECLARE(VlcbNetAdptErr, SendPkt, _INTERFACE_SELF_PTR_MUT(IVlcbNetAdpt), const VlcbNetAdptPkt *const pkt);_INTERFACE_METHOD_DECLARE(VlcbNetAdptCaps, Caps, _INTERFACE_SELF_PTR(IVlcbNetAdpt));  )

◆ vlcb_net_adpt_ErrToStr()

vlcb_error vlcb_net_adpt_ErrToStr ( VlcbNetAdptErr err)

Definition at line 7 of file adapter.c.

Here is the caller graph for this function: