@Override
 public void receiveData(Context context, int transactionId, PebbleDictionary data) {
   Follow followMe = ((DroidPlannerApp) applicationContext).followMe;
   PebbleKit.sendAckToPebble(applicationContext, transactionId);
   int request = (data.getInteger(KEY_PEBBLE_REQUEST).intValue());
   switch (request) {
     case KEY_REQUEST_MODE_FOLLOW:
       followMe.toggleFollowMeState();
       break;
     case KEY_REQUEST_CYCLE_FOLLOW_TYPE:
       followMe.cycleType();
       break;
     case KEY_REQUEST_MODE_LOITER:
       ((DroidPlannerApp) applicationContext)
           .getDrone()
           .state
           .changeFlightMode(ApmModes.ROTOR_LOITER);
       break;
     case KEY_REQUEST_MODE_RTL:
       ((DroidPlannerApp) applicationContext)
           .getDrone()
           .state
           .changeFlightMode(ApmModes.ROTOR_RTL);
       break;
   }
 }
示例#2
0
 @Override
 public void onStop() {
   super.onStop();
   dpApp.removeApiListener(this);
 }
示例#3
0
 protected Drone getDrone() {
   return dpApp.getDrone();
 }
示例#4
0
 @Override
 public void onStart() {
   super.onStart();
   dpApp.addApiListener(this);
 }
示例#5
0
 protected MissionProxy getMissionProxy() {
   return dpApp.getMissionProxy();
 }