public override void Connect(BluetoothEndPoint remoteEP)
        {
            // TESTING
            if (!TestUtilities.IsUnderTestHarness())
            {
                _fcty.ToJavaUuid(BluetoothService.ObexObjectPush);
                _fcty.ToJavaUuid(Guid.NewGuid());
            }
            //--
            var cloneEP = (BluetoothEndPoint)remoteEP.Clone();
            var dev     = (AndroidBthDeviceInfo)_fcty.DoGetBluetoothDeviceInfoInternalOnly(remoteEP.Address);
            var sock    = dev.CreateSocket(cloneEP, _auth, _encr);

            sock.Connect();
            SetupConnection(sock);
        }
示例#2
0
        internal BluetoothSocket CreateSocket(BluetoothEndPoint remoteEP, bool auth, bool encr)
        {
            BluetoothSocket s;

            if (remoteEP.HasPort)
            {
                s = CreateSocketToPort(_dev, remoteEP.Port, auth, encr);
            }
            if (auth || encr)
            {
                s = _dev.CreateRfcommSocketToServiceRecord(
                    _fcty.ToJavaUuid(remoteEP.Service));
            }
            else
            {
                s = _dev.CreateInsecureRfcommSocketToServiceRecord(
                    _fcty.ToJavaUuid(remoteEP.Service));
            }
            return(s);
        }
 void IBluetoothListener.Construct(Guid service)
 {
     _svcClassOrig = service;
     _svcClass     = _fcty.ToJavaUuid(service);
 }