コード例 #1
0
        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
ファイル: AndroidBthInquiry.cs プロジェクト: jehy/32feet.NET
 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);
 }
コード例 #7
0
 internal AndroidBthListener(AndroidBthFactoryBase fcty)
 {
     _fcty = fcty;
 }
コード例 #8
0
 internal AndroidBthClient(AndroidBthFactoryBase fcty)
 {
     _fcty = fcty;
 }