CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::cosim Namespace Reference

Classes

class  RpcServer
 TODO: make this a proper backend (as much as possible). More...
class  FaultStash
 Cross-thread error channel for the IXWebSocket network thread. 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 uint64_t kProtocolVersion = 4
 Wire protocol version.
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 33 of file RpcWire.h.

Referenced by esi::cosim::RpcServer::Impl::transportLoop().

◆ 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 52 of file RpcWire.h.

References kDataFrameHeaderSize.

Referenced by esi::cosim::RpcServer::Impl::handleBinaryFrame().

Variable Documentation

◆ kDataFrameHeaderSize

size_t esi::cosim::kDataFrameHeaderSize = 8
inlineconstexpr

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

Definition at line 46 of file RpcWire.h.

Referenced by parseDataFrame().

◆ kProtocolVersion

uint64_t esi::cosim::kProtocolVersion = 4
inlineconstexpr

Wire protocol version.

Both ends must agree exactly; see hello in cosim-protocol.md.

Definition at line 30 of file RpcWire.h.

Referenced by esi::cosim::RpcServer::Impl::handleHello().