internal static IBluetoothClient CreateFromListener(AndroidBthFactoryBase fcty, BluetoothSocket sock)
        {
            var cli = new AndroidBthClient(fcty);

            cli.SetupConnection(sock);
            return(cli);
        }
示例#2
0
        internal static AndroidBthDeviceInfo CreateFromBondedList(AndroidBthFactoryBase fcty, BluetoothDevice dev)
        {
            var bdi = new AndroidBthDeviceInfo(fcty, dev);

            bdi._rmbd = bdi._authd = true;
            return(bdi);
        }
示例#3
0
 internal AndroidBthInquiry(AndroidBthFactoryBase fcty)
 {
     _fcty = fcty;
     //_acty = new Activity();
     var context = GetContext();
     StartReceiver(context);
 }
示例#4
0
        internal static AndroidBthDeviceInfo CreateFromInquiry(
            AndroidBthFactoryBase fcty, BluetoothDevice dev,
            BluetoothClass cod, string nameOpt, short rssiOpt)
        {
            var bdi = new AndroidBthDeviceInfo(fcty, dev);

            bdi._discoTime   = DateTime.UtcNow;
            bdi._cod         = AndroidBthUtils.ConvertCoDs(cod);
            bdi._rssiAtDisco = rssiOpt;
            Debug.Assert(bdi._dev.Name == nameOpt);
            return(bdi);
        }
示例#5
0
        internal static AndroidBthDeviceInfo CreateFromGivenAddress(
            AndroidBthFactoryBase fcty, BluetoothAddress address,
            bool queryOrInternalOnly)
        {
            BluetoothAdapter a = fcty.GetAdapter();
            var dev            = a.GetRemoteDevice(AndroidBthUtils.FromBluetoothAddress(address));
            var bdi            = new AndroidBthDeviceInfo(fcty, dev);

            //
            if (queryOrInternalOnly)
            {
                bdi._rmbd = bdi._authd = (dev.BondState == Bond.Bonded);
                var cod = dev.BluetoothClass;
                if (cod != null)
                {
                    bdi._cod = AndroidBthUtils.ConvertCoDs(cod);
                }
            }
            return(bdi);
        }
示例#6
0
 // Use factory methods!!
 private AndroidBthDeviceInfo(AndroidBthFactoryBase fcty, BluetoothDevice dev)
 {
     _fcty = fcty;
     _dev  = dev;
     _addr = BluetoothAddress.Parse(dev.Address);
 }
 internal AndroidBthListener(AndroidBthFactoryBase fcty)
 {
     _fcty = fcty;
 }
 internal AndroidBthClient(AndroidBthFactoryBase fcty)
 {
     _fcty = fcty;
 }