RTno is communicating library and framework which allows you to make your embedded device capable of communicating with RT-middleware world. RT-middleware is a platform software to realize Robotic system. In RTM, robots are developed by constructing robotics technologies\' elements (components) named RT-component. Therefore, the RTno helps you to create your own RT-component with your mbed and arduino. To know how to use your RTno device, visit here: http://ysuga.net/robot_e/rtm_e/rtc_e/1065?lang=en To know about RT-middleware and RT-component, visit http://www.openrtm.org

Dependencies:   EthernetNetIf

Dependents:   RTnoV3_LED RTnoV3_Template RTnoV3_ADC RTnoV3_Timer ... more

Revision:
0:9fac71a0bff3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OutPort.h	Thu Feb 09 02:33:10 2012 +0000
@@ -0,0 +1,58 @@
+#ifndef OUTPORT_HEADER_INCLUDED
+#define OUTPORT_HEADER_INCLUDED
+
+/*******************************************
+ * OutPort.h
+ * @author Yuki Suga
+ * @copyright Yuki Suga (ysuga.net) Nov, 10th, 2010.
+ * @license LGPLv3
+ *****************************************/
+
+#include <stdint.h>
+#include "PortBase.h"
+#include "PortBuffer.h"
+#include "NullBuffer.h"
+#include "TypeCode.h"
+#include <string.h>
+#include <stdlib.h>
+
+class OutPortBase : public PortBase {
+ private:
+
+ public:
+  OutPortBase(const char* name, char tCode) {
+    PortBase_init(this, name, tCode, NullBuffer_create());
+  }
+
+ public:
+
+};
+
+template<typename T>
+class OutPort : public OutPortBase {
+ private:
+  T* m_pData;
+  
+ public:
+ OutPort(const char* name, T& data) : OutPortBase(name, data.typeCode) {
+    m_pData = &data;
+  }
+  ~OutPort() {}
+
+ public:
+  uint8_t write() {
+    uint8_t size = TypeCode_getElementSize(m_pData->typeCode);
+    if(TypeCode_isSequence(m_pData->typeCode)) {
+      size *= ((SequenceBase*)&(m_pData->data))->length();
+      pPortBuffer->push(pPortBuffer,
+            (int8_t*)((SequenceBase*)&(m_pData->data))->getData(),
+            size);
+    } else {
+      pPortBuffer->push(pPortBuffer, (const int8_t*)&(m_pData->data), size);
+    }
+    return size;
+  }
+};
+
+
+#endif