_BRB_PSM structure (bthddi.h)

The _BRB_PSM structure describes a Protocol/Service Multiplexer (PSM) to register or unregister.

Syntax

struct _BRB_PSM {
  BRB_HEADER Hdr;
  USHORT     Psm;
};

Members

Hdr

A BRB_HEADER structure that contains information about the current BRB.

Psm

When the _BRB_PSM structure is passed as input for a BRB_REGISTER_PSM BRB call, this is the PSM that the profile driver attempts to register. If the profile driver sets this value to zero, the PSM is dynamically generated. If the profile driver specified zero on BRB_REGISTER_PSM input, on output this member contains the PSM that was registered.

When the _BRB_PSM structure is passed as input for a BRB_UNREGISTER_PSM BRB call, this is the PSM that the profile driver attempts to unregister. This value must be a PSM that is currently registered. For more information about valid PSM values, see the Remarks section.

Some PSMs are reserved for use by Windows:

SDP: 0x01

RFCOMM: 0x03

HID Control: 0x11

HID Data: 0x13

BNEP: 0x0F

Remarks

To register a PSM, profile drivers should build and send a BRB_REGISTER_PSM request.

After a PSM has been registered, the profile driver can receive connection notifications from remote devices and can build and send BRB_L2CA_OPEN_CHANNEL_RESPONSE requests to accept incoming connections.

The profile driver can specify a particular PSM or can request that a PSM be dynamically generated by specifying PSM_INVALID in the Psm member. If the profile driver specifies PSM_INVALID, on output the PSM assigned will be returned in the Psm member of the structure.

The Bluetooth driver stack registers PSMs for the following profiles: HCRP, HID, PAN, SDP, and RFCOMM.

For more information about L2CAP servers and PSMs, see Accepting L2CAP Connections in a Bluetooth Profile Driver.

Profile drivers cannot register a PSM that has already been registered by another driver. If one attempts to do so, a STATUS_ALREADY_COMMITTED error will be returned. The BRB_REGISTER_PSM request has no effect on SDP records. After registering a PSM, drivers can advertise the PSM over SDP by sending the IOCTL_BTH_SDP_SUBMIT_RECORD IOCTL.

To unregister a previously registered PSM, profile drivers should build and send a BRB_UNREGISTER_PSM request. Profile drivers must specify a PSM that is currently registered. If a profile driver sends a BRB_REGISTER_PSM request with a value of zero in the Psm member, the dynamically assigned PSM value should be passed in the BRB_UNREGISTER_PSM request.

A BRB_UNREGISTER_PSM request has no effect on SDP records that attempt to connect to the PSM. Profile drivers can remove relevant SDP records by sending the IOCTL_BTH_SDP_REMOVE_RECORD IOCTL.

Requirements

Requirement Value
Minimum supported client Versions:_Supported in Windows Vista, and later.
Header bthddi.h (include Bthddi.h)

See also

BRB_HEADER

BRB_L2CA_OPEN_CHANNEL_RESPONSE

BRB_REGISTER_PSM

BRB_UNREGISTER_PSM

IOCTL_BTH_SDP_REMOVE_RECORD

IOCTL_BTH_SDP_SUBMIT_RECORD