Java Code Examples for android.bluetooth.BluetoothGattServer#STATE_DISCONNECTED

The following examples show how to use android.bluetooth.BluetoothGattServer#STATE_DISCONNECTED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: P_NativeServerWrapper.java    From AsteroidOSSync with GNU General Public License v3.0 6 votes vote down vote up
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;
		}
	}
}
 
Example 2
Source File: P_NativeServerWrapper.java    From SweetBlue with GNU General Public License v3.0 6 votes vote down vote up
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;
		}
	}
}
 
Example 3
Source File: P_NativeServerWrapper.java    From AsteroidOSSync with GNU General Public License v3.0 5 votes vote down vote up
public final int getNativeState(final String macAddress)
{
	if( m_nativeConnectionStates.containsKey(macAddress) )
	{
		return m_nativeConnectionStates.get(macAddress);
	}
	else
	{
		return BluetoothGattServer.STATE_DISCONNECTED;
	}
}
 
Example 4
Source File: P_NativeServerWrapper.java    From SweetBlue with GNU General Public License v3.0 5 votes vote down vote up
public final int getNativeState(final String macAddress)
{
	if( m_nativeConnectionStates.containsKey(macAddress) )
	{
		return m_nativeConnectionStates.get(macAddress);
	}
	else
	{
		return BluetoothGattServer.STATE_DISCONNECTED;
	}
}
 
Example 5
Source File: P_NativeServerWrapper.java    From AsteroidOSSync with GNU General Public License v3.0 4 votes vote down vote up
public final boolean isDisconnected(final String macAddress)
{
	return getNativeState(macAddress) == BluetoothGattServer.STATE_DISCONNECTED;
}
 
Example 6
Source File: P_NativeServerWrapper.java    From AsteroidOSSync with GNU General Public License v3.0 4 votes vote down vote up
public final boolean isDisconnectingOrDisconnected(final String macAddress)
{
	final int  nativeState = getNativeState(macAddress);

	return nativeState == BluetoothGattServer.STATE_DISCONNECTING || nativeState == BluetoothGattServer.STATE_DISCONNECTED;
}
 
Example 7
Source File: P_NativeServerWrapper.java    From SweetBlue with GNU General Public License v3.0 4 votes vote down vote up
public final boolean isDisconnected(final String macAddress)
{
	return getNativeState(macAddress) == BluetoothGattServer.STATE_DISCONNECTED;
}
 
Example 8
Source File: P_NativeServerWrapper.java    From SweetBlue with GNU General Public License v3.0 4 votes vote down vote up
public final boolean isDisconnectingOrDisconnected(final String macAddress)
{
	final int  nativeState = getNativeState(macAddress);

	return nativeState == BluetoothGattServer.STATE_DISCONNECTING || nativeState == BluetoothGattServer.STATE_DISCONNECTED;
}