public Neighbor(AndroidBluetoothAdapter androidBluetoothAdapter, InboundBluetoothSocketTable inboundBluetoothSocketTable, BluetoothDevice device) { this.androidBluetoothAdapter = androidBluetoothAdapter; this.inboundBluetoothSocketTable = inboundBluetoothSocketTable; this.device = device; inboundChannel = new DisconnectableChannel <byte[], NotConnectedException>(disconnectedChannel, ChannelFactory.Nonblocking <byte[]>()); }
public AndroidBluetoothAdapter( Context applicationContext, BluetoothAdapter bluetoothAdapter, BluetoothDiscoveryFacade bluetoothDiscoveryFacade, InboundBluetoothSocketTable inboundBluetoothSocketTable ) { this.bluetoothAdapter = bluetoothAdapter; this.bluetoothDiscoveryFacade = bluetoothDiscoveryFacade; this.inboundBluetoothSocketTable = inboundBluetoothSocketTable; // bluetoothAdapter.Address lies. See // http://stackoverflow.com/questions/33377982/get-bluetooth-local-mac-address-in-marshmallow var bluetoothAddress = Android.Provider.Settings.Secure.GetString(applicationContext.ContentResolver, "bluetooth_address"); AdapterId = MacUtilities.ConvertMacToGuid(bluetoothAddress); }
public static BluetoothServer Create(BluetoothAdapter adapter, InboundBluetoothSocketTable inboundBluetoothSocketTable) { return(new BluetoothServer(adapter, inboundBluetoothSocketTable)); }
private BluetoothServer(BluetoothAdapter adapter, InboundBluetoothSocketTable inboundBluetoothSocketTable) { this.adapter = adapter; this.inboundBluetoothSocketTable = inboundBluetoothSocketTable; }