1 package org.ocera.orte.demo;
3 import org.ocera.orte.*;
4 import org.ocera.orte.types.*;
7 public class SpeedMotionType extends MessageData
9 public short[] speed = new short[2];
11 public SpeedMotionType(DomainApp domainApp, String newTopic) {
14 this.setTopic(newTopic);
15 b = domainApp.regNewDataType("motion_speed",getMaxDataLength());
17 System.out.println(":j!: cannot register data type!");
25 buffer.putShort(this.speed[0]);
26 buffer.putShort(this.speed[1]);
33 public int getMaxDataLength()
36 len += ORTEConstant.SHORT_FIELD_SIZE;
37 len += ORTEConstant.SHORT_FIELD_SIZE;
41 public String toString()
43 String data = new String();
45 data += (" left = " + speed[0]);
46 data += (" right = " + speed[1]);