esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
transport-force-endpointid.hpp
Go to the documentation of this file.
1#ifndef NDNPH_FACE_TRANSPORT_FORCE_ENDPOINTID_HPP
2#define NDNPH_FACE_TRANSPORT_FORCE_ENDPOINTID_HPP
3
4#include "transport.hpp"
5
6namespace ndnph {
7namespace transport {
8
16public:
17 explicit ForceEndpointId(Transport& inner, uint64_t endpointId = 0)
19 , m_endpointId(endpointId) {}
20
21private:
22 bool doSend(const uint8_t* pkt, size_t pktLen, uint64_t) final {
23 return inner.send(pkt, pktLen, m_endpointId);
24 }
25
26private:
27 uint64_t m_endpointId;
28};
29
30} // namespace transport
31} // namespace ndnph
32
33#endif // NDNPH_FACE_TRANSPORT_FORCE_ENDPOINTID_HPP
Overwrite endpointId of outgoing packets.
Definition transport-force-endpointid.hpp:15
bool doSend(const uint8_t *pkt, size_t pktLen, uint64_t) final
Definition transport-force-endpointid.hpp:22
ForceEndpointId(Transport &inner, uint64_t endpointId=0)
Definition transport-force-endpointid.hpp:17
Wrap another transport.
Definition transport.hpp:61
Transport & inner
Definition transport.hpp:90
Base class of low-level transport.
Definition transport.hpp:10
bool send(const uint8_t *pkt, size_t pktLen, uint64_t endpointId=0)
Synchronously transmit a packet.
Definition transport.hpp:33
Definition fs.hpp:33