[openrtm-commit:02068] r858 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 10月 18日 (火) 17:35:45 JST
Author: win-ei
Date: 2016-10-18 17:35:44 +0900 (Tue, 18 Oct 2016)
New Revision: 858
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/SharedMemory.java
Log:
Fixed bugs. refs #3395
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java 2016-10-17 03:04:37 UTC (rev 857)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMConsumer.java 2016-10-18 08:35:44 UTC (rev 858)
@@ -49,7 +49,7 @@
// rtcout.setLevel("PARANOID");
-// m_orb = ORBUtil.getOrb();
+ m_orb = ORBUtil.getOrb();
}
/**
* {@.ja 設定初期化}
@@ -143,8 +143,12 @@
EncapsOutputStreamExt cdr;
cdr = (EncapsOutputStreamExt)data;
byte[] ch = cdr.getByteArray();
+ EncapsOutputStreamExt output_stream
+ = new EncapsOutputStreamExt(m_orb, m_connector.isLittleEndian());
+ output_stream.write_octet_array(ch,0,ch.length);
CdrDataHolder cdr_data = new CdrDataHolder();
- cdr_data.value = ch;
+ //cdr_data.value = ch;
+ cdr_data.value = output_stream.getByteArray();
m_shmem.write(cdr_data);
ret = inportcdr.put();
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/SharedMemory.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/SharedMemory.java 2016-10-17 03:04:37 UTC (rev 857)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/SharedMemory.java 2016-10-18 08:35:44 UTC (rev 858)
@@ -201,12 +201,12 @@
buffer.order(ByteOrder.LITTLE_ENDIAN);
- org.omg.CORBA.LongHolder len = new org.omg.CORBA.LongHolder(data.value.length);
+ //org.omg.CORBA.LongHolder len = new org.omg.CORBA.LongHolder(data.value.length);
EncapsOutputStreamExt cdr
= new EncapsOutputStreamExt(ORBUtil.getOrb(),true);
- len._write(cdr);
+ //len._write(cdr);
//cdr.write_ulong(data.value.length);
- //cdr.write_ulonglong(data.value.length);
+ cdr.write_ulonglong(data.value.length);
byte[] ch = cdr.getByteArray();
buffer.put(ch, 0, ch.length);
@@ -248,9 +248,12 @@
= new EncapsOutputStreamExt(ORBUtil.getOrb(),true);
cdr.write_octet_array(len_data, 0, len_data.length);
InputStream instream = cdr.create_input_stream();
- org.omg.CORBA.LongHolder len = new org.omg.CORBA.LongHolder();
- len._read(instream);
- data.value = new byte[(int)len.value];
+ //org.omg.CORBA.LongHolder len = new org.omg.CORBA.LongHolder();
+ //len._read(instream);
+ //data.value = new byte[(int)len.value];
+ //long len = instream.read_ulong();
+ long len = instream.read_ulonglong();
+ data.value = new byte[(int)len];
buffer.get(data.value);
//buffer.get(data.value,8,data.value.length);
channel.close();
More information about the openrtm-commit
mailing list