A new object oriented network api that can be used to replace the one provided by the EthernetInterface library.

Dependents:   NetRelais TCP_Client_Example TCP_Server_Example UDP_Server_Example ... more

Object oriented network interface for the mbed platform

Currently implemented:

  • Address
  • Endpoint
  • UDP Socket
  • TCP Socket
  • Databuffer
  • Select API

It depends on the EthernetInterface for the lwip network stack.

Please do not hesitate to contact me with any remarks, improvements or questions.

The API is also available for unix at GitHub: LibNosa

Examples

Files at this revision

API Documentation at this revision

Comitter:
NegativeBlack
Date:
Wed Jul 18 19:43:12 2012 +0000
Parent:
6:847a0b218e22
Child:
8:cdee0f2b6ff0
Commit message:
Small update, added Buffer::flush() method.

Changed in this revision

buffer.cpp Show annotated file Show diff for this revision Revisions of this file
buffer.hpp Show annotated file Show diff for this revision Revisions of this file
--- a/buffer.cpp	Wed Jul 18 15:31:16 2012 +0000
+++ b/buffer.cpp	Wed Jul 18 19:43:12 2012 +0000
@@ -95,6 +95,16 @@
     return bytes_to_copy;
 }
 
+int
+Buffer::flush()
+{
+    if (this->_memory == NULL) {
+        return -1;
+    }
+
+    std::memset(this->_memory, 0, this->_size);
+}
+
 void *
 Buffer::pointer(size_t offset)
 {
--- a/buffer.hpp	Wed Jul 18 15:31:16 2012 +0000
+++ b/buffer.hpp	Wed Jul 18 19:43:12 2012 +0000
@@ -47,6 +47,7 @@
             
             int read(void *data, size_t max_length, size_t offset = 0);
             int write(const void *data, size_t length, size_t offset = 0);
+            int flush();
             
             void *pointer(size_t offset = 0);
             void setLength(size_t length);