All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
esp8266-tcp-transport-lite.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_ESP8266_TCP_TRANSPORT_LITE_HPP
24 #define NDN_ESP8266_TCP_TRANSPORT_LITE_HPP
25 
26 #ifdef ARDUINO
27 
28 #include <WiFiClient.h>
29 #include "../../c/common.h"
30 #include "../../c/errors.h"
31 #include "../../c/encoding/element-reader-types.h"
32 #include "../util/dynamic-uint8-array-lite.hpp"
33 #include "../encoding/element-listener-lite.hpp"
34 
35 namespace ndn {
36 
41 class Esp8266TcpTransportLite {
42 public:
54  Esp8266TcpTransportLite(DynamicUInt8ArrayLite& buffer);
55 
67  ndn_Error
68  connect(const char* host, int port, ElementListenerLite& elementListener);
69 
76  ndn_Error
77  send(const uint8_t* data, size_t dataLength);
78 
93  ndn_Error
94  processEvents(uint8_t *buffer, size_t bufferLength);
95 
100  ndn_Error
101  close();
102 
103 private:
104  ndn_ElementReader elementReader_;
105  WiFiClient client_;
106 };
107 
108 }
109 
110 #endif // ARDUINO
111 
112 #endif
A ndn_ElementReader lets you call ndn_ElementReader_onReceivedData multiple times which uses an ndn_T...
Definition: element-reader-types.h:59