本文整理汇总了Java中com.o3dr.services.android.lib.drone.connection.ConnectionType.TYPE_BLUETOOTH属性的典型用法代码示例。如果您正苦于以下问题:Java ConnectionType.TYPE_BLUETOOTH属性的具体用法?Java ConnectionType.TYPE_BLUETOOTH怎么用?Java ConnectionType.TYPE_BLUETOOTH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.o3dr.services.android.lib.drone.connection.ConnectionType
的用法示例。
在下文中一共展示了ConnectionType.TYPE_BLUETOOTH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateConnectionSettings
private void updateConnectionSettings() {
if(this.rootPref == null)
return;
hideAllPrefs();
final int connectionType = prefs.getConnectionParameterType();
switch(connectionType){
case ConnectionType.TYPE_USB:
this.rootPref.addPreference(this.usbPrefs);
break;
case ConnectionType.TYPE_TCP:
this.rootPref.addPreference(this.tcpPrefs);
break;
case ConnectionType.TYPE_UDP:
this.rootPref.addPreference(this.udpPrefs);
break;
case ConnectionType.TYPE_BLUETOOTH:
this.rootPref.addPreference(this.bluetoothPrefs);
break;
case ConnectionType.TYPE_SOLO:
break;
}
}
示例2: updateConnectionPreferenceSummary
private void updateConnectionPreferenceSummary(Preference preference, int connectionType) {
String connectionName;
switch (connectionType) {
case ConnectionType.TYPE_USB:
connectionName = "USB";
break;
case ConnectionType.TYPE_UDP:
connectionName = "UDP";
break;
case ConnectionType.TYPE_TCP:
connectionName = "TCP";
break;
case ConnectionType.TYPE_BLUETOOTH:
connectionName = "BLUETOOTH";
break;
default:
connectionName = null;
break;
}
if (connectionName != null)
preference.setSummary(connectionName);
}
示例3: retrieveConnectionParameters
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;
}