internal BOND_RETURN_CODE Bond_(BluetoothAddress device, string pin) { Utils.MiscUtils.Trace_WriteLine("Calling CBtIf:Bond..."); BOND_RETURN_CODE ret = _factory.GetWidcommBtInterface().Bond(device, pin); Utils.MiscUtils.Trace_WriteLine("Bond returned: {0} = 0x{1:X}", ret, (int)ret); return ret; }
private IAsyncResult BeginGetServiceRecordsUnparsedWidcomm(Guid service, AsyncCallback callback, object state) { WidcommBtInterface iface = m_factory.GetWidcommBtInterface(); IAsyncResult ar = iface.BeginServiceDiscovery(DeviceAddress, service, SdpSearchScope.Anywhere, callback, state); return(ar); }
//-------------------------------------------------------------- /// <summary> /// Called after reading the device from the Registry, to find if it is paired. /// </summary> internal static void CheckAndSetIfPaired(WidcommBluetoothDeviceInfo bdi, WidcommBluetoothFactoryBase factory) { Debug.Assert(bdi.m_remembered == true, "should be already marked as rembered"); Debug.Assert(!bdi.m_remDevInfo.b_paired, "why rechecking?"); if (!bdi.m_remDevInfo.b_paired) { bool paired = factory.GetWidcommBtInterface().BondQuery(bdi.m_remDevInfo.bda); bdi.m_remDevInfo.b_paired = paired; } }
internal static WidcommBluetoothDeviceInfo CreateFromGivenAddress(BluetoothAddress address, WidcommBluetoothFactoryBase factory) { REM_DEV_INFO rdi = new REM_DEV_INFO(); rdi.bda = WidcommUtils.FromBluetoothAddress(address); WidcommBluetoothDeviceInfo bdi = factory.GetWidcommBtInterface() .ReadDeviceFromRegistryAndCheckAndSetIfPaired(address, factory); if (bdi == null) { bdi = CreateFromGivenAddressNoLookup(address, factory); } return(bdi); }