Android Open Source - HexNanoController_Android O S D Common






From Project

Back to project page HexNanoController_Android.

License

The source code is released under:

Code license GNU GPL v2 http://www.gnu.org/licenses/gpl.html Content license CC BY-NC-SA 4.0 http://creativecommons.org/licenses/by-nc-sa/4.0/

If you think the Android project HexNanoController_Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * //  w  w  w.java  2s .  co  m
 */
package com.hexairbot.hexmini.modal;

/**
 * @author koupoo
 *
 */
public class OSDCommon {
  public enum MSPCommnand{
     MSP_IDENT(100),
     MSP_STATUS(101),               
     MSP_RAW_IMU(102),               
     MSP_SERVO(103),                 
     MSP_MOTOR(104),                 
     MSP_RC(105),                    
     MSP_RAW_GPS(106),               
     MSP_COMP_GPS(107),              
     MSP_ATTITUDE(108),              
     MSP_ALTITUDE(109),              
     MSP_BAT(110),                   
     MSP_RC_TUNING(111),             
     MSP_PID(112),                   
     MSP_BOX(113),                   
     MSP_MISC(114),                  
     MSP_MOTOR_PINS(115),            
     MSP_BOXNAMES(116),              
     MSP_PIDNAMES(117),              
     MSP_SET_RAW_RC_TINY(150),       
     MSP_ARM(151),                   
     MSP_DISARM(152),                
     MSP_TRIM_UP(153),               
     MSP_TRIM_DOWN(154),             
     MSP_TRIM_LEFT(155),             
     MSP_TRIM_RIGHT(156),            
     MSP_SET_RAW_RC(200),            
     MSP_SET_RAW_GPS(201),           
     MSP_SET_PID(202),               
     MSP_SET_BOX(203),               
     MSP_SET_RC_TUNING(204),         
     MSP_ACC_CALIBRATION(205),       
     MSP_MAG_CALIBRATION(206),       
     MSP_SET_MISC(207),              
     MSP_RESET_CONF(208),            
     MSP_EEPROM_WRITE(250),          
     MSP_DEBUG(254);                 

    private int commandName;
    
    private MSPCommnand(int commandName){
      this.commandName = commandName;
    }
    
    public int value(){
      return commandName;
    }
  }
  
  public static String getDefaultOSDDataRequest() {
    return null;
  }
  
  public static byte[] getSimpleCommand(MSPCommnand command){
    byte dataPackage[] = new byte[6];
    
    dataPackage[0] = '$';
    dataPackage[1] = 'M';
    dataPackage[2] = '<';
    dataPackage[3] = 0;
    dataPackage[4] = (byte) command.value();
    
      byte checkSum = 0;
      
      int dataSizeIdx = 3;
      int checkSumIdx = 5;
      
      checkSum ^= (dataPackage[dataSizeIdx] & 0xFF);
      checkSum ^= (dataPackage[dataSizeIdx + 1] & 0xFF);
      
      dataPackage[checkSumIdx] = checkSum;
    
    return dataPackage;
  }
}




Java Source Code List

.FileHelper.java
.Input.java
.Output.java
.Serializable.java
com.hexairbot.hexmini.HelpActivity.java
com.hexairbot.hexmini.HexMiniApplication.java
com.hexairbot.hexmini.HudActivity.java
com.hexairbot.hexmini.HudViewControllerDelegate.java
com.hexairbot.hexmini.HudViewController.java
com.hexairbot.hexmini.SettingsDialogDelegate.java
com.hexairbot.hexmini.SettingsDialog.java
com.hexairbot.hexmini.SettingsViewControllerDelegate.java
com.hexairbot.hexmini.SettingsViewController.java
com.hexairbot.hexmini.ViewController.java
com.hexairbot.hexmini.adapter.SettingsViewAdapter.java
com.hexairbot.hexmini.ble.BleConnectinManagerDelegate.java
com.hexairbot.hexmini.ble.BleConnectinManager.java
com.hexairbot.hexmini.ble.BluetoothLeService.java
com.hexairbot.hexmini.gestures.EnhancedGestureDetector.java
com.hexairbot.hexmini.modal.ApplicationSettings.java
com.hexairbot.hexmini.modal.Channel.java
com.hexairbot.hexmini.modal.OSDCommon.java
com.hexairbot.hexmini.modal.Transmitter.java
com.hexairbot.hexmini.sensors.DeviceOrientationChangeDelegate.java
com.hexairbot.hexmini.sensors.DeviceOrientationManager.java
com.hexairbot.hexmini.sensors.DeviceSensorManagerWrapper.java
com.hexairbot.hexmini.sensors.SensorManagerWrapper.java
com.hexairbot.hexmini.services.ConnectStateManager.java
com.hexairbot.hexmini.services.IpcControlService.java
com.hexairbot.hexmini.services.IpcProxy.java
com.hexairbot.hexmini.services.NavData.java
com.hexairbot.hexmini.services.OnIpcConnectChangedListener.java
com.hexairbot.hexmini.services.VIConfig.java
com.hexairbot.hexmini.ui.Button.java
com.hexairbot.hexmini.ui.Image.java
com.hexairbot.hexmini.ui.Indicator.java
com.hexairbot.hexmini.ui.Sprite.java
com.hexairbot.hexmini.ui.Text.java
com.hexairbot.hexmini.ui.ToggleButton.java
com.hexairbot.hexmini.ui.UIRenderer.java
com.hexairbot.hexmini.ui.control.CustomSeekBar.java
com.hexairbot.hexmini.ui.control.ViewPagerIndicator.java
com.hexairbot.hexmini.ui.gl.GLSprite.java
com.hexairbot.hexmini.ui.joystick.AcceleratorJoystick.java
com.hexairbot.hexmini.ui.joystick.AnalogueJoystick.java
com.hexairbot.hexmini.ui.joystick.JoystickBase.java
com.hexairbot.hexmini.ui.joystick.JoystickFactory.java
com.hexairbot.hexmini.ui.joystick.JoystickListener.java
com.hexairbot.hexmini.util.DebugHandler.java
com.hexairbot.hexmini.util.FontUtils.java
com.hexairbot.hexmini.util.SystemUiHiderBase.java
com.hexairbot.hexmini.util.SystemUiHiderHoneycomb.java
com.hexairbot.hexmini.util.SystemUiHider.java
com.hexairbot.hexmini.util.SystemUtil.java
com.hexairbot.hexmini.util.TextureUtils.java
fix.android.opengl.GLES20.java