RfcommDeviceService Kelas
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mewakili instans layanan pada perangkat Bluetooth BR.
public ref class RfcommDeviceService sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RfcommDeviceService final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class RfcommDeviceService final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RfcommDeviceService : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class RfcommDeviceService : System.IDisposable
Public NotInheritable Class RfcommDeviceService
Implements IDisposable
- Warisan
- Atribut
- Penerapan
Persyaratan Windows
Rangkaian perangkat |
Windows 10 (diperkenalkan dalam 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
API contract |
Windows.Foundation.UniversalApiContract (diperkenalkan dalam v1.0)
|
Kemampuan aplikasi |
bluetooth
|
Keterangan
Riwayat versi
Versi Windows | Versi SDK | Nilai ditambahkan |
---|---|---|
1607 | 14393 | DeviceAccessInformation |
1607 | 14393 | GetDeviceSelectorForBluetoothDevice(BluetoothDevice) |
1607 | 14393 | GetDeviceSelectorForBluetoothDevice(BluetoothDevice,BluetoothCacheMode) |
1607 | 14393 | GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice,RfcommServiceId) |
1607 | 14393 | GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice,RfcommServiceId,BluetoothCacheMode) |
1607 | 14393 | RequestAccessAsync |
Properti
ConnectionHostName |
Mendapatkan nama host koneksi instans layanan RFCOMM, yang digunakan untuk menyambungkan ke perangkat jarak jauh. |
ConnectionServiceName |
Mendapatkan nama layanan koneksi instans layanan RFCOMM, yang digunakan untuk menyambungkan ke perangkat jarak jauh. |
Device |
Mendapatkan objek BluetoothDevice yang menjelaskan perangkat yang terkait dengan objek RfcommDeviceService saat ini. |
DeviceAccessInformation |
Informasi akses perangkat. Digunakan untuk memeriksa dan memantau akses. |
MaxProtectionLevel |
Mendapatkan SocketProtectionLevel maksimum yang didukung oleh instans layanan RFCOMM ini. |
ProtectionLevel |
Mendapatkan SocketProtectionLevel saat ini dari instans layanan RFCOMM. |
ServiceId |
Mendapatkan RfcommServiceId dari instans layanan RFCOMM ini. |
Metode
Close() |
Menutup perangkat RFCOMM. |
Dispose() |
Melakukan tugas yang ditentukan aplikasi yang terkait dengan membebaskan, merilis, atau mengatur ulang sumber daya yang tidak dikelola. |
FromIdAsync(String) |
Mendapatkan objek RfcommDeviceService dari Id DeviceInformation untuk instans layanan RFCOMM. |
GetDeviceSelector(RfcommServiceId) |
Mendapatkan string Advanced Query Syntax (AQS) untuk mengidentifikasi instans layanan RFCOMM. String ini diteruskan ke metode CreateWatcher . |
GetDeviceSelectorForBluetoothDevice(BluetoothDevice) |
Mendapatkan string Advanced Query Syntax (AQS) untuk mengidentifikasi instans semua layanan Rfcomm pada perangkat Bluetooth jarak jauh. |
GetDeviceSelectorForBluetoothDevice(BluetoothDevice, BluetoothCacheMode) |
Mendapatkan string Advanced Query Syntax (AQS) untuk mengidentifikasi instans cache dari semua layanan Rfcomm pada perangkat Bluetooth jarak jauh. |
GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId) |
Mendapatkan string Advanced Query Syntax (AQS) untuk mengidentifikasi instans layanan Rfcomm pada perangkat Bluetooth jarak jauh. |
GetDeviceSelectorForBluetoothDeviceAndServiceId(BluetoothDevice, RfcommServiceId, BluetoothCacheMode) |
Mendapatkan string Advanced Query Syntax (AQS) untuk mengidentifikasi instans layanan Rfcomm pada perangkat Bluetooth jarak jauh. |
GetSdpRawAttributesAsync() |
Mendapatkan atribut SDP cache dari instans layanan RFCOMM. |
GetSdpRawAttributesAsync(BluetoothCacheMode) |
Mendapatkan atribut SDP dari instans layanan RFCOMM. |
RequestAccessAsync() |
Digunakan untuk meminta akses eksplisit ke layanan Rfcomm. Ini memanggil Persetujuan Perangkat dan harus dipanggil pada utas UI. Secara default, perangkat yang tidak berpasangan tidak memerlukan persetujuan, sementara perangkat yang dipasangkan melakukannya. FromIdAsync hanya akan menampilkan permintaan persetujuan saat dipanggil untuk perangkat yang dipasangkan. RequestAccessAsync memungkinkan aplikasi untuk membuat permintaan akses eksplisit jika perangkat dapat dipasangkan di masa mendatang melalui penggunaan perangkat lainnya. |
Berlaku untuk
Saran dan Komentar
Kirim dan lihat umpan balik untuk