CIRCT 23.0.0git
Loading...
Searching...
No Matches
Classes | Functions | Variables
esi::cosim Namespace Reference

Classes

class  FaultStash
 Cross-thread error channel for the IXWebSocket network thread. More...
 
class  RpcServer
 TODO: make this a proper backend (as much as possible). More...
 

Functions

std::string buildDataFrame (uint64_t channelId, const uint8_t *bytes, size_t size)
 Pack a cosim binary data frame: [u64 LE channel_id][payload].
 
bool parseDataFrame (const std::string &data, uint64_t &channelId, const uint8_t *&payload, size_t &payloadSize)
 Parse a cosim binary data frame.
 

Variables

constexpr size_t kDataFrameHeaderSize = 8
 Size of the binary data-frame header (LE channel_id).
 

Function Documentation

◆ buildDataFrame()

std::string esi::cosim::buildDataFrame ( uint64_t  channelId,
const uint8_t *  bytes,
size_t  size 
)
inline

Pack a cosim binary data frame: [u64 LE channel_id][payload].

Definition at line 29 of file RpcWire.h.

Referenced by esi::cosim::RpcServer::Impl::transportLoop(), and esi::backends::cosim::RpcClient::Impl::writeToServer().

◆ parseDataFrame()

bool esi::cosim::parseDataFrame ( const std::string &  data,
uint64_t &  channelId,
const uint8_t *&  payload,
size_t &  payloadSize 
)
inline

Parse a cosim binary data frame.

On success returns true and sets channelId to the decoded id; payload / payloadSize point into data past the header. Returns false if data is too short to contain the header.

Definition at line 48 of file RpcWire.h.

References kDataFrameHeaderSize.

Referenced by esi::backends::cosim::RpcClient::Impl::handleBinaryFrame(), and esi::cosim::RpcServer::Impl::handleBinaryFrame().

Variable Documentation

◆ kDataFrameHeaderSize

constexpr size_t esi::cosim::kDataFrameHeaderSize = 8
inlineconstexpr

Size of the binary data-frame header (LE channel_id).

Definition at line 42 of file RpcWire.h.

Referenced by parseDataFrame().