NOW LOADING

MidiBluetoothPeripheralClientPolicy


Whether a remote device connecting to this PC is let in without asking
Namespace Windows.Devices.Midi2.Transports.Bluetooth
Type Name MidiBluetoothPeripheralClientPolicy
Type WinRT Enumeration (a 32-bit unsigned or signed integer)
IDL MidiBluetoothPeripheralClientPolicyEnum.idl

Reported by MidiBluetoothPeripheralStatus.ClientPolicy.

Values

Value Numeric Value Description
RequireApproval 0 A device that connects waits for someone to approve or deny it
AllowAny 1 Any device that connects gets a MIDI endpoint right away

What approval does

Bluetooth doesn’t let Windows refuse the connection itself. A device that connects stays connected either way. Approval controls whether it gets a MIDI endpoint, and whether any data gets through.

So with RequireApproval, a device that hasn’t been approved stays connected and silent until someone decides. Call MidiBluetoothTransportManager.GetPendingPeripheralClients from time to time to find the ones waiting, and decide on each with ApprovePeripheralClientAsync or DenyPeripheralClientAsync.

AllowAny is handy on a PC you control. But it means any Bluetooth MIDI device in range can connect and send messages into this PC without anyone being asked.

Didn't find what you were looking for?

Windows MIDI Services is an open source project with all source available on GitHub. We have a great community on Discord as well. Between GitHub and Discord, you should find the information you are looking for.