Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get the minor Class of Device value for a Bluetooth Imaging device.
using System;
using Windows.Devices.Bluetooth;
namespace InTheHand.Devices.Bluetooth
{
/// <summary>
/// Defines missing values in the <see cref="BluetoothMinorClass"/> enumeration for devices with a <see cref="BluetoothClassOfDevice.MajorClass"/> of Imaging.
/// </summary>
[Flags]
public enum BluetoothImagingMinorClass
{
Uncategorized = 0,
Display = 4,
Camera = 8,
Scanner = 16,
Printer = 32,
}
/// <summary>
/// Provides an extension method to get the Imaging minor class.
/// </summary>
public static class BluetoothClassOfDeviceExtensions
{
/// <summary>
/// Returns the Minor Class of Device for an Imaging device.
/// </summary>
/// <param name="classOfDevice"></param>
/// <returns></returns>
public static BluetoothImagingMinorClass GetImagingMinorClass(this BluetoothClassOfDevice classOfDevice)
{
return (BluetoothImagingMinorClass)((int)classOfDevice.MinorClass);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.