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) {
13 this.setTopic(newTopic);
14 if (!domainApp.regNewDataType("motion_speed",getMaxDataLength())) {
15 System.out.println(":j!: cannot register data type \"motion_speed\"!");
23 buffer.putShort(this.speed[0]);
24 buffer.putShort(this.speed[1]);
30 this.speed[0] = buffer.getShort();
31 this.speed[1] = buffer.getShort();
35 public int getMaxDataLength()
37 return 2 * ORTEConstant.SHORT_FIELD_SIZE;