import org.ocera.orte.types.NtpTime;
import org.ocera.orte.types.RecvInfo;
import org.ocera.orte.types.SubsProp;
+import org.ocera.orte.types.ORTEConstant;
public class HokuyoScanSubscribe extends SubscriptionCallback{
- public final static int IMMEDIATE = 0x02;
- public final static int BEST_EFFORTS = 0x01;
-
private Subscription sub;
private HokuyoView view;
private HokuyoScanType hokuyomsg;
"hokuyo_scan",
minSeparation,
deadline,
- IMMEDIATE,
- BEST_EFFORTS,
+ ORTEConstant.IMMEDIATE,
+ ORTEConstant.BEST_EFFORTS,
0);
}
}
public void callback(RecvInfo info, MessageData msg) {
- view.setData(((HokuyoScanType)msg).hokuyo);
- }
-}
\ No newline at end of file
+ if (info.getRecvStatus() == ORTEConstant.NEW_DATA)
+ view.setData(((HokuyoScanType)msg).hokuyo);
+ }
+}
import org.ocera.orte.types.NtpTime;
import org.ocera.orte.types.RecvInfo;
import org.ocera.orte.types.SubsProp;
+import org.ocera.orte.types.ORTEConstant;
public class MotionSpeedSubscribe extends SubscriptionCallback{
- public final static int IMMEDIATE = 0x02;
- public final static int BEST_EFFORTS = 0x01;
-
private Subscription sub;
private HokuyoView view;
private SpeedMotionType speedmsg;
"motion_speed",
minSeparation,
deadline,
- IMMEDIATE,
- BEST_EFFORTS,
+ ORTEConstant.IMMEDIATE,
+ ORTEConstant.BEST_EFFORTS,
0);
}
}
public void callback(RecvInfo info, MessageData msg) {
- view.setDataMotion(((SpeedMotionType)msg).speed);
- //System.out.println(msg);
- }
-}
\ No newline at end of file
+ if (info.getRecvStatus() == ORTEConstant.NEW_DATA)
+ view.setDataMotion(((SpeedMotionType)msg).speed);
+ }
+}
import org.ocera.orte.types.NtpTime;
import org.ocera.orte.types.RecvInfo;
import org.ocera.orte.types.SubsProp;
+import org.ocera.orte.types.ORTEConstant;
import android.os.Bundle;
import android.os.Handler;
public class PwrVoltageSubscribe extends SubscriptionCallback{
- public final static int IMMEDIATE = 0x02;
- public final static int BEST_EFFORTS = 0x01;
-
static Handler handler;
private Subscription sub;
"pwr_voltage",
minSeparation,
deadline,
- IMMEDIATE,
- BEST_EFFORTS,
+ ORTEConstant.IMMEDIATE,
+ ORTEConstant.BEST_EFFORTS,
0);
}
}
public void callback(RecvInfo info, MessageData msg) {
- Message message = handler.obtainMessage();
- Bundle bundle = new Bundle();
-
- bundle.putDoubleArray("voltages", ((PwrVoltageType)msg).voltage.clone());
- message.setData(bundle);
- handler.sendMessage(message);
+ if (info.getRecvStatus() == ORTEConstant.NEW_DATA) {
+ Message message = handler.obtainMessage();
+ Bundle bundle = new Bundle();
+
+ bundle.putDoubleArray("voltages", ((PwrVoltageType)msg).voltage.clone());
+ message.setData(bundle);
+ handler.sendMessage(message);
+ }
}
-}
\ No newline at end of file
+}