当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionType.Type方法代码示例

本文整理汇总了Java中com.o3dr.services.android.lib.drone.connection.ConnectionType.Type方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionType.Type方法的具体用法?Java ConnectionType.Type怎么用?Java ConnectionType.Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.o3dr.services.android.lib.drone.connection.ConnectionType的用法示例。


在下文中一共展示了ConnectionType.Type方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startDroneSession

import com.o3dr.services.android.lib.drone.connection.ConnectionType; //导入方法依赖的package包/类
private void startDroneSession(long startTime) {
    ConnectionParameter connParams = drone.getConnectionParameter();
    @ConnectionType.Type int connectionType = connParams.getConnectionType();
    final String connectionTypeLabel = ConnectionType.getConnectionTypeLabel(connectionType);
    Uri tlogLoggingUri = connParams.getTLogLoggingUri();

    // Record the starting drone session
    currentSessionId = this.sessionDB.startSession(startTime, connectionTypeLabel, tlogLoggingUri);
    if(tlogLoggingUri != null && dpPrefs.isDroneshareEnabled()){
        //Create an entry in the droneshare upload queue
        droneShareDb.queueDataUploadEntry(dpPrefs.getDroneshareLogin(), currentSessionId);
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:14,代码来源:DroidPlannerApp.java

示例2: setConnectionParameterType

import com.o3dr.services.android.lib.drone.connection.ConnectionType; //导入方法依赖的package包/类
public void setConnectionParameterType(@ConnectionType.Type int connectionType) {
    prefs.edit().putString(PREF_CONNECTION_TYPE, String.valueOf(connectionType)).apply();
    lbm.sendBroadcast(new Intent(PREF_CONNECTION_TYPE));
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:DroidPlannerPrefs.java

示例3: getConnectionParameterType

import com.o3dr.services.android.lib.drone.connection.ConnectionType; //导入方法依赖的package包/类
/**
 * @return the selected mavlink connection type.
 */
public @ConnectionType.Type int getConnectionParameterType() {
    @ConnectionType.Type int connectionType = Integer.parseInt(prefs.getString(PREF_CONNECTION_TYPE, DEFAULT_CONNECTION_TYPE).trim());
    return connectionType;
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:8,代码来源:DroidPlannerPrefs.java

示例4: retrieveConnectionParameters

import com.o3dr.services.android.lib.drone.connection.ConnectionType; //导入方法依赖的package包/类
private ConnectionParameter retrieveConnectionParameters() {
    final @ConnectionType.Type int connectionType = dpPrefs.getConnectionParameterType();

    // Generate the uri for logging the tlog data for this session.
    Uri tlogLoggingUri = TLogUtils.getTLogLoggingUri(getApplicationContext(),
        connectionType, System.currentTimeMillis());

    ConnectionParameter connParams;
    switch (connectionType) {
        case ConnectionType.TYPE_USB:
            connParams = ConnectionParameter.newUsbConnection(dpPrefs.getUsbBaudRate(),
                tlogLoggingUri, EVENTS_DISPATCHING_PERIOD);
            break;

        case ConnectionType.TYPE_UDP:
            if (dpPrefs.isUdpPingEnabled()) {
                connParams = ConnectionParameter.newUdpWithPingConnection(
                    dpPrefs.getUdpServerPort(),
                    dpPrefs.getUdpPingReceiverIp(),
                    dpPrefs.getUdpPingReceiverPort(),
                    "Hello".getBytes(),
                    ConnectionType.DEFAULT_UDP_PING_PERIOD,
                    tlogLoggingUri,
                    EVENTS_DISPATCHING_PERIOD);
            }
            else{
                connParams = ConnectionParameter.newUdpConnection(dpPrefs.getUdpServerPort(),
                    tlogLoggingUri, EVENTS_DISPATCHING_PERIOD);
            }
            break;

        case ConnectionType.TYPE_TCP:
            connParams = ConnectionParameter.newTcpConnection(dpPrefs.getTcpServerIp(),
                dpPrefs.getTcpServerPort(), tlogLoggingUri, EVENTS_DISPATCHING_PERIOD);
            break;

        case ConnectionType.TYPE_BLUETOOTH:
            String btAddress = dpPrefs.getBluetoothDeviceAddress();
            if (TextUtils.isEmpty(btAddress)) {
                connParams = null;
                startActivity(new Intent(getApplicationContext(),
                        BluetoothDevicesActivity.class)
                        .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));

            } else {
                connParams = ConnectionParameter.newBluetoothConnection(btAddress,
                    tlogLoggingUri, EVENTS_DISPATCHING_PERIOD);
            }
            break;

        default:
            Log.e(TAG, "Unrecognized connection type: " + connectionType);
            connParams = null;
            break;
    }

    return connParams;
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:59,代码来源:DroidPlannerApp.java

示例5: getTLogLoggingUri

import com.o3dr.services.android.lib.drone.connection.ConnectionType; //导入方法依赖的package包/类
/**
 * Returns the uri where the tlog data should be logged.
 * @param context
 * @param connectionType
 * @param connectionTimestamp
 * @return
 */
public static Uri getTLogLoggingUri(Context context, @ConnectionType.Type int connectionType, long connectionTimestamp){
    File tlogLoggingFile = new File(getTLogsDirectory(context),
        getTLogFilename(ConnectionType.getConnectionTypeLabel(connectionType), connectionTimestamp));
    return Uri.fromFile(tlogLoggingFile);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:13,代码来源:TLogUtils.java


注:本文中的com.o3dr.services.android.lib.drone.connection.ConnectionType.Type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。