arduino-yun-tcp-transport-lite.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_ARDUINO_YUN_TRANSPORT_LITE_HPP
23 #define NDN_ARDUINO_YUN_TRANSPORT_LITE_HPP
24 
25 #ifdef ARDUINO
26 
27 #include <YunClient.h>
28 #include "../../c/common.h"
29 #include "../../c/errors.h"
30 #include "../../c/encoding/element-reader-types.h"
31 #include "../util/dynamic-uint8-array-lite.hpp"
32 #include "../encoding/element-listener-lite.hpp"
33 
34 namespace ndn {
35 
41 class ArduinoYunTcpTransportLite {
42 public:
54  ArduinoYunTcpTransportLite(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  YunClient client_;
106 };
107 
108 }
109 
110 #endif // ARDUINO
111 
112 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
A ndn_ElementReader lets you call ndn_ElementReader_onReceivedData multiple times which uses an ndn_T...
Definition: element-reader-types.h:59