esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | List of all members
ndnph::BridgeTransport Class Reference

Virtual transport that connects to a peer. More...

#include <bridge-transport.hpp>

Inherits ndnph::transport::Transport, and ndnph::transport::DynamicRxQueueMixin.

Public Member Functions

bool begin (BridgeTransport &peer)
 Connect to peer transport.
 
bool end ()
 Disconnect from peer transport.
 
- Public Member Functions inherited from ndnph::transport::Transport
virtual ~Transport ()=default
 
bool isUp () const
 Determine whether transport is connected.
 
void loop ()
 Process periodical events, such as receiving packets.
 
void setRxCallback (RxCallback cb, void *ctx)
 Set incoming packet callback.
 
bool send (const uint8_t *pkt, size_t pktLen, uint64_t endpointId=0)
 Synchronously transmit a packet.
 

Private Member Functions

bool doIsUp () const final
 
void doLoop () final
 
bool doSend (const uint8_t *pkt, size_t pktLen, uint64_t endpointId) final
 

Additional Inherited Members

- Public Types inherited from ndnph::transport::Transport
using RxCallback = void(*)(void *ctx, const uint8_t *pkt, size_t pktLen, uint64_t endpointId)
 
- Static Public Attributes inherited from ndnph::transport::DynamicRxQueueMixin
static constexpr size_t DEFAULT_BUFLEN = 1500
 
- Protected Member Functions inherited from ndnph::transport::Transport
void invokeRxCallback (const uint8_t *pkt, size_t pktLen, uint64_t endpointId=0)
 Invoke incoming packet callback for a received packet.
 
- Protected Member Functions inherited from ndnph::transport::DynamicRxQueueMixin
 DynamicRxQueueMixin (size_t bufLen=DEFAULT_BUFLEN)
 Constructor.
 
- Protected Member Functions inherited from ndnph::transport::RxQueueMixin
template<typename F >
void initAllocBuffers (const F &makeRegion)
 Allocate receive buffers during initialization.
 
RxContext receiving ()
 Receive packets in a loop.
 
void loopRxQueue ()
 Process periodical events.
 

Detailed Description

Virtual transport that connects to a peer.

Member Function Documentation

◆ begin()

bool ndnph::BridgeTransport::begin ( BridgeTransport peer)
inline

Connect to peer transport.

Postcondition
Packets sent on one transport are received at the other.

◆ doIsUp()

bool ndnph::BridgeTransport::doIsUp ( ) const
inlinefinalprivatevirtual

◆ doLoop()

void ndnph::BridgeTransport::doLoop ( )
inlinefinalprivatevirtual

◆ doSend()

bool ndnph::BridgeTransport::doSend ( const uint8_t *  pkt,
size_t  pktLen,
uint64_t  endpointId 
)
inlinefinalprivatevirtual

◆ end()

bool ndnph::BridgeTransport::end ( )
inline

Disconnect from peer transport.


The documentation for this class was generated from the following file: