RfcommDeviceService RfcommDeviceService RfcommDeviceService RfcommDeviceService Class

Represents an instance of a service on a Bluetooth BR device.

Syntax

Declaration

public sealed class RfcommDeviceServicepublic sealed class RfcommDeviceServicePublic NotInheritable Class RfcommDeviceService

Properties summary

Gets the connection host name of the RFCOMM service instance, which is used to connect to the remote device.

Gets the connection service name of the RFCOMM service instance, which is used to connect to the remote device.

Gets the BluetoothDevice object describing the device associated with the current RfcommDeviceService object.

The device access information. Used to check and monitor access.

Gets the maximum SocketProtectionLevel supported by this RFCOMM service instance.

Gets the current SocketProtectionLevel of the RFCOMM service instance.

Gets the RfcommServiceId of this RFCOMM service instance.

Methods summary

Closes the RFCOMM device.

Gets an RfcommDeviceService object from a DeviceInformation Id for an RFCOMM service instance.

Gets an Advanced Query Syntax (AQS) string for identifying instances of an RFCOMM service. This string is passed to the CreateWatcher() method.

Gets an Advanced Query Syntax (AQS) string for identifying instances of all Rfcomm services on a remote Bluetooth device.

Gets an Advanced Query Syntax (AQS) string for identifying cached instances of all Rfcomm services on a remote Bluetooth device.

Gets an Advanced Query Syntax (AQS) string for identifying instances of Rfcomm services on a remote Bluetooth device.

Gets an Advanced Query Syntax (AQS) string for identifying instances of Rfcomm services on a remote Bluetooth device.

Gets the cached SDP attributes of the RFCOMM service instance.

Gets the SDP attributes of the RFCOMM service instance.

Used to request explicit access to the Rfcomm service. This invokes Device Consent and must be called on the UI thread. By default, unpaired devices do not require consent, while paired devices do. FromIdAsync(System.String) will only display a consent prompt when called for a paired device. RequestAccessAsync() allows the app to make the access request explicit in the event where the device may become paired in the future through other uses of the device.

Properties

  • ConnectionHostName
    ConnectionHostName
    ConnectionHostName
    ConnectionHostName

    Gets the connection host name of the RFCOMM service instance, which is used to connect to the remote device.

    public HostName ConnectionHostName { get; }public HostName ConnectionHostName { get; }Public ReadOnly Property ConnectionHostName As HostName

    Property Value

  • ConnectionServiceName
    ConnectionServiceName
    ConnectionServiceName
    ConnectionServiceName

    Gets the connection service name of the RFCOMM service instance, which is used to connect to the remote device.

    public string ConnectionServiceName { get; }public string ConnectionServiceName { get; }Public ReadOnly Property ConnectionServiceName As string

    Property Value

    • string
      string
      string
      string

      The ServiceName object of the RFCOMM service instance.

  • Device
    Device
    Device
    Device

    Gets the BluetoothDevice object describing the device associated with the current RfcommDeviceService object.

    public BluetoothDevice Device { get; }public BluetoothDevice Device { get; }Public ReadOnly Property Device As BluetoothDevice

    Property Value

  • DeviceAccessInformation
    DeviceAccessInformation
    DeviceAccessInformation
    DeviceAccessInformation

    The device access information. Used to check and monitor access.

    public DeviceAccessInformation DeviceAccessInformation { get; }public DeviceAccessInformation DeviceAccessInformation { get; }Public ReadOnly Property DeviceAccessInformation As DeviceAccessInformation

    Property Value

  • MaxProtectionLevel
    MaxProtectionLevel
    MaxProtectionLevel
    MaxProtectionLevel

    Gets the maximum SocketProtectionLevel supported by this RFCOMM service instance.

    public SocketProtectionLevel MaxProtectionLevel { get; }public SocketProtectionLevel MaxProtectionLevel { get; }Public ReadOnly Property MaxProtectionLevel As SocketProtectionLevel

    Property Value

  • ProtectionLevel
    ProtectionLevel
    ProtectionLevel
    ProtectionLevel

    Gets the current SocketProtectionLevel of the RFCOMM service instance.

    public SocketProtectionLevel ProtectionLevel { get; }public SocketProtectionLevel ProtectionLevel { get; }Public ReadOnly Property ProtectionLevel As SocketProtectionLevel

    Property Value

  • ServiceId
    ServiceId
    ServiceId
    ServiceId

    Gets the RfcommServiceId of this RFCOMM service instance.

    public RfcommServiceId ServiceId { get; }public RfcommServiceId ServiceId { get; }Public ReadOnly Property ServiceId As RfcommServiceId

    Property Value

Methods

  • Close()
    Close()
    Close()
    Close()

    Closes the RFCOMM device.

    public void Close()public void Close()Public Function Close() As void
  • FromIdAsync(System.String)
    FromIdAsync(System.String)
    FromIdAsync(System.String)
    FromIdAsync(System.String)

    Gets an RfcommDeviceService object from a DeviceInformation Id for an RFCOMM service instance.

    public static IAsyncOperation<RfcommDeviceService> FromIdAsync(System.String)public static IAsyncOperation<RfcommDeviceService> FromIdAsync(System.String)Public Static Function FromIdAsync(System.String) As IAsyncOperation( Of RfcommDeviceService )

    Parameters

    • deviceId
      System.String
      System.String
      System.String
      System.String

      The DeviceInformation Id that identifies the RFCOMM service instance. This id can be retrieved from Windows.Devices.Enumeration.

    Returns

    • The RfcommDeviceService object that represents the RFCOMM service instance.

    Remarks

    The first time this method is invoked by a store app, it should be called from a UI thread in order to display the consent prompt. After the user has granted consent, the method can be invoked from any application thread.

    If a store app has not declared the right capabilities or the user does not grant consent, the method returns a null object.

    Warning

    If the device acting as the RFCOMM server does not have the correct channel registered in its manifest, this method throws an exception when called on the device acting as the RFCOMM client.

  • GetDeviceSelector(Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)
    GetDeviceSelector(Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)
    GetDeviceSelector(Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)
    GetDeviceSelector(Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)

    Gets an Advanced Query Syntax (AQS) string for identifying instances of an RFCOMM service. This string is passed to the CreateWatcher() method.

    public static string GetDeviceSelector(Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)public static string GetDeviceSelector(Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)Public Static Function GetDeviceSelector(Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId) As string

    Parameters

    Returns

    • string
      string
      string
      string

      An AQS string for identifying RFCOMM service instances.

  • GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice)
    GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice)
    GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice)
    GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice)

    Gets an Advanced Query Syntax (AQS) string for identifying instances of all Rfcomm services on a remote Bluetooth device.

    public static string GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice)public static string GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice)Public Static Function GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice) As string

    Parameters

    Returns

    • string
      string
      string
      string

      The AQS string for identifying instances of all Rfcomm services on a remote Bluetooth device.

  • GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.BluetoothCacheMode)

    Gets an Advanced Query Syntax (AQS) string for identifying cached instances of all Rfcomm services on a remote Bluetooth device.

    public static string GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.BluetoothCacheMode)public static string GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.BluetoothCacheMode)Public Static Function GetDeviceSelectorForBluetoothDevice(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.BluetoothCacheMode) As string

    Parameters

    Returns

    • string
      string
      string
      string

      The AQS string for identifying cached instances of all Rfcomm services on a remote Bluetooth device.

  • GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)
    GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)
    GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)
    GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)

    Gets an Advanced Query Syntax (AQS) string for identifying instances of Rfcomm services on a remote Bluetooth device.

    public static string GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)public static string GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId)Public Static Function GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId) As string

    Parameters

    Returns

    • string
      string
      string
      string

      The AQS string for identifying instances of Rfcomm services.

  • GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId,Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId,Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId,Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId,Windows.Devices.Bluetooth.BluetoothCacheMode)

    Gets an Advanced Query Syntax (AQS) string for identifying instances of Rfcomm services on a remote Bluetooth device.

    public static string GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId,Windows.Devices.Bluetooth.BluetoothCacheMode)public static string GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId,Windows.Devices.Bluetooth.BluetoothCacheMode)Public Static Function GetDeviceSelectorForBluetoothDeviceAndServiceId(Windows.Devices.Bluetooth.BluetoothDevice,Windows.Devices.Bluetooth.Rfcomm.RfcommServiceId,Windows.Devices.Bluetooth.BluetoothCacheMode) As string

    Parameters

    Returns

    • string
      string
      string
      string

      The AQS string for identifying instances of Rfcomm services.

  • GetSdpRawAttributesAsync()
    GetSdpRawAttributesAsync()
    GetSdpRawAttributesAsync()
    GetSdpRawAttributesAsync()

    Gets the cached SDP attributes of the RFCOMM service instance.

    public IAsyncOperation<IBuffer>> GetSdpRawAttributesAsync()public IAsyncOperation<IBuffer>> GetSdpRawAttributesAsync()Public Function GetSdpRawAttributesAsync() As IAsyncOperation( Of IBuffer )

    Returns

    • The SDP attributes of the RFCOMM service instance.

  • GetSdpRawAttributesAsync(Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetSdpRawAttributesAsync(Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetSdpRawAttributesAsync(Windows.Devices.Bluetooth.BluetoothCacheMode)
    GetSdpRawAttributesAsync(Windows.Devices.Bluetooth.BluetoothCacheMode)

    Gets the SDP attributes of the RFCOMM service instance.

    public IAsyncOperation<IBuffer>> GetSdpRawAttributesAsync(Windows.Devices.Bluetooth.BluetoothCacheMode)public IAsyncOperation<IBuffer>> GetSdpRawAttributesAsync(Windows.Devices.Bluetooth.BluetoothCacheMode)Public Function GetSdpRawAttributesAsync(Windows.Devices.Bluetooth.BluetoothCacheMode) As IAsyncOperation( Of IBuffer )

    Parameters

    Returns

    • The SDP attributes of the RFCOMM service instance.

  • RequestAccessAsync()
    RequestAccessAsync()
    RequestAccessAsync()
    RequestAccessAsync()

    Used to request explicit access to the Rfcomm service. This invokes Device Consent and must be called on the UI thread. By default, unpaired devices do not require consent, while paired devices do. FromIdAsync(System.String) will only display a consent prompt when called for a paired device. RequestAccessAsync() allows the app to make the access request explicit in the event where the device may become paired in the future through other uses of the device.

    public IAsyncOperation<DeviceAccessStatus> RequestAccessAsync()public IAsyncOperation<DeviceAccessStatus> RequestAccessAsync()Public Function RequestAccessAsync() As IAsyncOperation( Of DeviceAccessStatus )

    Returns

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute

Details

Assembly

Windows.Devices.Bluetooth.Rfcomm.dll