ndn-embeds 0.1.0
Lightweight NDN protocol stack for embedded systems
Loading...
Searching...
No Matches
api.cpp
1#include "ndn/ndn.hpp"
2
3namespace ndn {
4
5namespace {
6// Pointer to external Forwarder (set via setForwarder())
7// No longer owns an instance to save ~100KB of internal SRAM.
8Forwarder* g_forwarderPtr = nullptr;
9} // namespace
10
12 g_forwarderPtr = &fw;
13}
14
16 return *g_forwarderPtr;
17}
18
20 // Lightweight init - Forwarder is managed by the application.
21 // Call setForwarder() to register the application's Forwarder
22 // before using convenience APIs (expressInterest, putData, etc.)
23 return Error::Success;
24}
25
26} // namespace ndn
NDN Forwarder.
Definition forwarder.hpp:99
Error
Error codes.
Definition common.hpp:24
NDN Protocol Stack for ESP32 - Main include file.
void setForwarder(Forwarder &fw)
Register the application's Forwarder for convenience APIs.
Definition api.cpp:11
Forwarder & getForwarder()
Get the global Forwarder instance.
Definition api.cpp:15
Error initialize()
Initialize the NDN protocol stack.
Definition api.cpp:19