RfcommDeviceService RfcommDeviceService RfcommDeviceService RfcommDeviceService Class

Definition

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

public : sealed class RfcommDeviceService : IRfcommDeviceService, IRfcommDeviceService2, IRfcommDeviceService3, IClosablepublic sealed class RfcommDeviceService : IRfcommDeviceService, IRfcommDeviceService2, IRfcommDeviceService3, IDisposablePublic NotInheritable Class RfcommDeviceService Implements IRfcommDeviceService, IRfcommDeviceService2, IRfcommDeviceService3, IDisposable// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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// You can use this property in JavaScript.
Value
HostName HostName HostName HostName

The HostName object of the RFCOMM service instance.

ConnectionServiceName ConnectionServiceName ConnectionServiceName ConnectionServiceName

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

public : PlatForm::String ConnectionServiceName { get; }public string ConnectionServiceName { get; }Public ReadOnly Property ConnectionServiceName As string// You can use this property in JavaScript.
Value
PlatForm::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// You can use this property in JavaScript.
Value
BluetoothDevice BluetoothDevice BluetoothDevice BluetoothDevice

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

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// You can use this property in JavaScript.
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

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// You can use this property in JavaScript.
Value
SocketProtectionLevel SocketProtectionLevel SocketProtectionLevel SocketProtectionLevel

The maximum SocketProtectionLevel of the RFCOMM service instance. This level can be passed to StreamSocket.ConnectAsync to upgrade the RFCOMM link protection level.

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// You can use this property in JavaScript.
Value
SocketProtectionLevel SocketProtectionLevel SocketProtectionLevel SocketProtectionLevel

The current SocketProtectionLevel of the remote RFCOMM service instance.

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// You can use this property in JavaScript.
Value
RfcommServiceId RfcommServiceId RfcommServiceId RfcommServiceId

The RfcommServiceId of the RFCOMM service instance.

Methods

Close() Close() Close() Close()

Closes the RFCOMM device.

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()

FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)

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

public : static IAsyncOperation<RfcommDeviceService> FromIdAsync(PlatForm::String deviceId)public static IAsyncOperation<RfcommDeviceService> FromIdAsync(String deviceId)Public Static Function FromIdAsync(deviceId As String) As IAsyncOperation( Of RfcommDeviceService )// You can use this method in JavaScript.
Parameters
deviceId
PlatForm::String String String String

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

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
bluetooth

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(RfcommServiceId) GetDeviceSelector(RfcommServiceId) GetDeviceSelector(RfcommServiceId) GetDeviceSelector(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 PlatForm::String GetDeviceSelector(RfcommServiceId serviceId)public static string GetDeviceSelector(RfcommServiceId serviceId)Public Static Function GetDeviceSelector(serviceId As RfcommServiceId) As string// You can use this method in JavaScript.
Parameters
serviceId
RfcommServiceId RfcommServiceId RfcommServiceId RfcommServiceId

The service id for which to query.

Returns
PlatForm::String string string string

An AQS string for identifying RFCOMM service instances.

GetDeviceSelectorForBluetoothDevice(BluetoothDevice) GetDeviceSelectorForBluetoothDevice(BluetoothDevice) GetDeviceSelectorForBluetoothDevice(BluetoothDevice) GetDeviceSelectorForBluetoothDevice(BluetoothDevice)

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

public : static PlatForm::String GetDeviceSelectorForBluetoothDevice(BluetoothDevice bluetoothDevice)public static string GetDeviceSelectorForBluetoothDevice(BluetoothDevice bluetoothDevice)Public Static Function GetDeviceSelectorForBluetoothDevice(bluetoothDevice As BluetoothDevice) As string// You can use this method in JavaScript.
Parameters
bluetoothDevice
BluetoothDevice BluetoothDevice BluetoothDevice BluetoothDevice

The remote bluetooth device.

Returns
PlatForm::String string string string

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

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

GetDeviceSelectorForBluetoothDevice(BluetoothDevice, BluetoothCacheMode) GetDeviceSelectorForBluetoothDevice(BluetoothDevice, BluetoothCacheMode) GetDeviceSelectorForBluetoothDevice(BluetoothDevice, BluetoothCacheMode) GetDeviceSelectorForBluetoothDevice(BluetoothDevice, BluetoothCacheMode)

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

public : static PlatForm::String GetDeviceSelectorForBluetoothDevice(BluetoothDevice bluetoothDevice, BluetoothCacheMode cacheMode)public static string GetDeviceSelectorForBluetoothDevice(BluetoothDevice bluetoothDevice, BluetoothCacheMode cacheMode)Public Static Function GetDeviceSelectorForBluetoothDevice(bluetoothDevice As BluetoothDevice, cacheMode As BluetoothCacheMode) As string// You can use this method in JavaScript.
Parameters
bluetoothDevice
BluetoothDevice BluetoothDevice BluetoothDevice BluetoothDevice

The remote Bluetooth device.

Returns
PlatForm::String string string string

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

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId) GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId) GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId) GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId)

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

public : static PlatForm::String GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice bluetoothDevice, RfcommServiceId serviceId)public static string GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice bluetoothDevice, RfcommServiceId serviceId)Public Static Function GetDeviceSelectorForBluetoothDeviceAndServiceId(bluetoothDevice As BluetoothDevice, serviceId As RfcommServiceId) As string// You can use this method in JavaScript.
Parameters
bluetoothDevice
BluetoothDevice BluetoothDevice BluetoothDevice BluetoothDevice

The remote Bluetooth device.

Returns
PlatForm::String string string string

The AQS string for identifying instances of Rfcomm services.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId, BluetoothCacheMode)

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

public : static PlatForm::String GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice bluetoothDevice, RfcommServiceId serviceId, BluetoothCacheMode cacheMode)public static string GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice bluetoothDevice, RfcommServiceId serviceId, BluetoothCacheMode cacheMode)Public Static Function GetDeviceSelectorForBluetoothDeviceAndServiceId(bluetoothDevice As BluetoothDevice, serviceId As RfcommServiceId, cacheMode As BluetoothCacheMode) As string// You can use this method in JavaScript.
Parameters
bluetoothDevice
BluetoothDevice BluetoothDevice BluetoothDevice BluetoothDevice

The remote bluetooth device.

Returns
PlatForm::String string string string

The AQS string for identifying instances of Rfcomm services.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

GetSdpRawAttributesAsync() GetSdpRawAttributesAsync() GetSdpRawAttributesAsync() GetSdpRawAttributesAsync()

Gets the cached SDP attributes of the RFCOMM service instance.

public : IAsyncOperation<IMapView<unsigned int, IBuffer>> GetSdpRawAttributesAsync()public IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>> GetSdpRawAttributesAsync()Public Function GetSdpRawAttributesAsync() As IAsyncOperation( Of IReadOnlyDictionaryuint, IBuffer )// You can use this method in JavaScript.
Returns
IAsyncOperation<IMapView<unsigned int, IBuffer>> IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>> IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>> IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>>

The SDP attributes of the RFCOMM service instance.

See Also

GetSdpRawAttributesAsync(BluetoothCacheMode) GetSdpRawAttributesAsync(BluetoothCacheMode) GetSdpRawAttributesAsync(BluetoothCacheMode) GetSdpRawAttributesAsync(BluetoothCacheMode)

Gets the SDP attributes of the RFCOMM service instance.

public : IAsyncOperation<IMapView<unsigned int, IBuffer>> GetSdpRawAttributesAsync(BluetoothCacheMode cacheMode)public IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>> GetSdpRawAttributesAsync(BluetoothCacheMode cacheMode)Public Function GetSdpRawAttributesAsync(cacheMode As BluetoothCacheMode) As IAsyncOperation( Of IReadOnlyDictionaryuint, IBuffer )// You can use this method in JavaScript.
Parameters
cacheMode
BluetoothCacheMode BluetoothCacheMode BluetoothCacheMode BluetoothCacheMode

Indicates whether SDP attributes should be retrieved from the cache or from the device.

Returns
IAsyncOperation<IMapView<unsigned int, IBuffer>> IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>> IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>> IAsyncOperation<IReadOnlyDictionary<uint, IBuffer>>

The SDP attributes of the RFCOMM service instance.

See Also

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 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 )// You can use this method in JavaScript.
Returns
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)