Ejemplo n.º 1
0
            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[]>());
            }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public static BluetoothServer Create(BluetoothAdapter adapter, InboundBluetoothSocketTable inboundBluetoothSocketTable)
 {
     return(new BluetoothServer(adapter, inboundBluetoothSocketTable));
 }
Ejemplo n.º 4
0
 private BluetoothServer(BluetoothAdapter adapter, InboundBluetoothSocketTable inboundBluetoothSocketTable)
 {
     this.adapter = adapter;
     this.inboundBluetoothSocketTable = inboundBluetoothSocketTable;
 }