added max-age and content-format

Fork of mbedConnectorInterface by Doug Anson

Revision:
24:a6915e19814e
Child:
25:1fc958ac14d1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/api/DataWrapper.h	Fri Mar 20 04:08:59 2015 +0000
@@ -0,0 +1,78 @@
+/**
+ * @file    DataWrapper.h
+ * @brief   mbed CoAP Endpoint Data Wrapper class
+ * @author  Doug Anson
+ * @version 1.0
+ * @see
+ *
+ * Copyright (c) 2014
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DATA_WRAPPER_H__
+#define __DATA_WRAPPER_H__
+
+// mbed support
+#include "mbed.h"
+
+class DataWrapper {
+    public:
+        /**
+        Default constructor
+        */
+        DataWrapper(uint8_t *data,int data_length);
+        
+        /**
+        Default copy constructor
+        */
+        DataWrapper(const DataWrapper &data);
+        
+        /**
+        Destructor
+        */
+        virtual ~DataWrapper();
+        
+        /**
+        Wrap the data
+        */
+        virtual void wrap(uint8_t *data,int data_length);
+        
+        /**
+        Unwrap the data
+        */
+        virtual void unwrap(uint8_t *data,int data_length);
+        
+        /**
+        Get the wrap/unwrap result
+        @return pointer to the data buffer of DataWrapper containing the wrap/unwrap result
+        */
+        uint8_t *get() { return this->m_data; }
+        
+        /**
+        Get the wrap/unwrap result length
+        @return length of the wrap/unwrap data result
+        */
+        int length() { return this->m_data_length; }
+        
+        /**
+        Reset the wrapper
+        */
+        void reset();
+    
+    private:
+        uint8_t *m_data;
+        int      m_data_length;
+};
+
+#endif // __DATA_WRAPPER_H__
\ No newline at end of file