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


Java BluetoothGattServer类代码示例

本文整理汇总了Java中android.bluetooth.BluetoothGattServer的典型用法代码示例。如果您正苦于以下问题:Java BluetoothGattServer类的具体用法?Java BluetoothGattServer怎么用?Java BluetoothGattServer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: assertThatAllClientsAreDisconnected

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
private void assertThatAllClientsAreDisconnected()
{
	if( m_nativeConnectionStates.size() == 0 )  return;

	for( String macAddress : m_nativeConnectionStates.keySet() )
	{
		final Integer state = m_nativeConnectionStates.get(macAddress);

		if( state != null && state != BluetoothGattServer.STATE_DISCONNECTED )
		{
			m_mngr.ASSERT(false, "Found a server connection state that is not disconnected when it should be.");

			return;
		}
	}
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:17,代码来源:P_NativeServerWrapper.java

示例2: PeerDevice

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
PeerDevice(BluetoothGattServer server) {
	mConnectionState = STATE_DISCONNECTED;
	mPeerRole = ROLE_CLIENT;
	mGattServer = server;
	mSending = false;
	mSendList = null;
}
 
开发者ID:blxble,项目名称:mesh-core-on-android,代码行数:8,代码来源:JniCallbacks.java

示例3: getNativeState

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public final int getNativeState(final String macAddress)
{
	if( m_nativeConnectionStates.containsKey(macAddress) )
	{
		return m_nativeConnectionStates.get(macAddress);
	}
	else
	{
		return BluetoothGattServer.STATE_DISCONNECTED;
	}
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:12,代码来源:P_NativeServerWrapper.java

示例4: isExecutable

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
@Override protected boolean isExecutable()
{
	boolean shouldBeExecutable = super.isExecutable() && getServer().m_nativeWrapper.getNativeState(m_macAddress) == BluetoothGattServer.STATE_CONNECTED;
	
	if( shouldBeExecutable )
	{
		return true;
	}
	
	return false;
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:12,代码来源:PA_Task_RequiresServerConnection.java

示例5: updateConnectedDevicesStatus

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
private void updateConnectedDevicesStatus() {
  final String message = getString(R.string.status_devicesConnected) + " "
      + mBluetoothManager.getConnectedDevices(BluetoothGattServer.GATT).size();
  runOnUiThread(new Runnable() {
    @Override
    public void run() {
      mConnectionStatus.setText(message);
    }
  });
}
 
开发者ID:WebBluetoothCG,项目名称:ble-test-peripheral-android,代码行数:11,代码来源:Peripheral.java

示例6: disconnectFromDevices

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
private void disconnectFromDevices() {
  Log.d(TAG, "Disconnecting devices...");
  for (BluetoothDevice device : mBluetoothManager.getConnectedDevices(
      BluetoothGattServer.GATT)) {
    Log.d(TAG, "Devices: " + device.getAddress() + " " + device.getName());
    mGattServer.cancelConnection(device);
  }
}
 
开发者ID:WebBluetoothCG,项目名称:ble-test-peripheral-android,代码行数:9,代码来源:Peripheral.java

示例7: addProfileToGATTServer

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public boolean addProfileToGATTServer(BluetoothGattServer server) {
	boolean fail = false;
	try {
		Thread.sleep(2000);
	} catch (InterruptedException e2) {
		e2.printStackTrace();
	}
	if (!server.addService(batteryService)) {
		fail = true;
		Log.d(TAG, "fail adding BatteryService");
	} else {
		Log.d(TAG, "added BatteryService");
	}
	try {
		Thread.sleep(2000);
	} catch (InterruptedException e1) {
		e1.printStackTrace();
	}
	if (!server.addService(HIDService)) {
		fail = true;
		Log.d(TAG, "fail adding HIDService");
	} else {
		Log.d(TAG, "added HIDService");
	}
	try {
		Thread.sleep(2000);
	} catch (InterruptedException e) {
		e.printStackTrace();
	}
	if (!server.addService(deviceInfoService)) {
		fail = true;
		Log.d(TAG, "fail adding DeviceInfoService");
	} else {
		Log.d(TAG, "added DeviceInfoService");
	}
	return !fail;
}
 
开发者ID:golvmopp,项目名称:BGSEP,代码行数:38,代码来源:HIDoverGattProfile.java

示例8: getGattServer

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public BluetoothGattServer getGattServer() {
		return mGattServer;
}
 
开发者ID:blxble,项目名称:mesh-core-on-android,代码行数:4,代码来源:JniCallbacks.java

示例9: setGattServer

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
void setGattServer(BluetoothGattServer gattServer) {
    mGattServer = gattServer;
}
 
开发者ID:RideBeeline,项目名称:android-bluetooth-current-time-service,代码行数:4,代码来源:CurrentTimeService.java

示例10: getNativeServer

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
@Override
public BluetoothGattServer getNativeServer()
{
    return null;
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:6,代码来源:UnitTestServerLayer.java

示例11: isDisconnecting

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public final boolean isDisconnecting(final String macAddress)
{
	return getNativeState(macAddress) == BluetoothGattServer.STATE_DISCONNECTING;
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:5,代码来源:P_NativeServerWrapper.java

示例12: isDisconnected

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public final boolean isDisconnected(final String macAddress)
{
	return getNativeState(macAddress) == BluetoothGattServer.STATE_DISCONNECTED;
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:5,代码来源:P_NativeServerWrapper.java

示例13: isConnected

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public final boolean isConnected(final String macAddress)
{
	return getNativeState(macAddress) == BluetoothGattServer.STATE_CONNECTED;
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:5,代码来源:P_NativeServerWrapper.java

示例14: isConnecting

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public final boolean isConnecting(final String macAddress)
{
	return getNativeState(macAddress) == BluetoothGattServer.STATE_CONNECTING;
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:5,代码来源:P_NativeServerWrapper.java

示例15: isConnectingOrConnected

import android.bluetooth.BluetoothGattServer; //导入依赖的package包/类
public final boolean isConnectingOrConnected(final String macAddress)
{
	final int  nativeState = getNativeState(macAddress);

	return nativeState == BluetoothGattServer.STATE_CONNECTING || nativeState == BluetoothGattServer.STATE_CONNECTED;
}
 
开发者ID:AsteroidOS,项目名称:AsteroidOSSync,代码行数:7,代码来源:P_NativeServerWrapper.java


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