// 32feet.NET - Personal Area Networking for .NET
//
// InTheHand.Net.Bluetooth.BTH_DEVICE_INFO
//
// Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
// This source code is licensed under the In The Hand Community License - see License.txt
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace InTheHand.Net.Bluetooth{
//
// The BTH_DEVICE_INFO structure stores information about a Bluetooth device.
//
[StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
internal struct BTH_DEVICE_INFO
{
//
// Combination BDIF_Xxx flags
//
internal BDIF flags;
//
// Address of remote device.
//
internal long address;
//
// Class Of Device.
//
internal uint classOfDevice;
//
// name of the device (As UTF8 String)
//
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = NativeMethods.BTH_MAX_NAME_SIZE)]
internal byte[] name;
}
[Flags]
internal enum BDIF : int
{
// The address member contains valid data.
ADDRESS = 0x00000001,
// The classOfDevice member contains valid data.
COD = 0x00000002,
// The name member contains valid data.
NAME = 0x00000004,
// The device is a remembered and authenticated device.
// The BDIF_PERSONAL flag is always set when this flag is set.
PAIRED = 0x00000008,
// The device is a remembered device.
// If this flag is set and the BDIF_PAIRED flag is not set, the device is not authenticated.
PERSONAL = 0x00000010,
// The remote Bluetooth device is currently connected to the local radio.
CONNECTED = 0x00000020,
//
// support added in kb942567
//
SHORT_NAME = 0x00000040,
VISIBLE = 0x00000080,
SSP_SUPPORTED = 0x00000100,
SSP_PAIRED = 0x00000200,
SSP_MITM_PROTECTED = 0x00000400,
RSSI = 0x00001000,
EIR = 0x00002000,
}
static class BDIFMasks
{
public const BDIF AllOrig = BDIF.ADDRESS | BDIF.COD | BDIF.NAME
| BDIF.PAIRED | BDIF.PERSONAL | BDIF.CONNECTED;
public const BDIF AllKb942567 = AllOrig
| BDIF.SHORT_NAME | BDIF.VISIBLE
| BDIF.SSP_SUPPORTED | BDIF.SSP_PAIRED | BDIF.SSP_MITM_PROTECTED
| BDIF.RSSI | BDIF.EIR;
}
}
|