Setting Friendly Names, Registering APOs
The Setting Friendly Names, Registering APOs topic describes how a Port Class Bluetooth sideband audio driver can set the friendly name for a device interface, and register any audio processing object (APO) that is used by the Bluetooth device.
For each enabled GUID_DEVINTERFACE_BLUETOOTH_HFP_SCO_HCIBYPASS interface, the Port Class audio driver (PortCls) normally calls the PcRegisterSubdevice function, which registers PnP device interfaces that represent a sub-device on an audio adapter. In typical audio driver designs, the audio driver calls PcRegisterSubdevice for “wave” and “topology” sub-devices, which are then connected by calling other Port Class functions.
Before calling PcRegisterSubdevice for the “topology” sub-device, the driver follows the procedure described in Setting Properties and Registry Values to set properties and registry values on the interface in the KSCATEGORY_AUDIO interface class. The specific properties and registry values are described in the following sections.
The audio driver sends an IOCTL_BTHHFP_DEVICE_GET_DESCRIPTOR request to the Hands-free profile (HFP) audio driver. The requested information is returned in the form of a BTHHFP_DESCRIPTOR structure, plus an other data referenced by the structure. The audio driver then calls IoSetDeviceInterfacePropertyData to set DEVPKEY_DeviceInterface_FriendlyName to the value in the FriendlyName field of the BTHHFP_DESCRIPTOR structure.
The audio driver sets the parameters to IoSetDeviceInterfacePropertyData as follows:
SymbolicLinkName = the string returned from IoRegisterDeviceInterface
PropertyKey = DEVPKEY_DeviceInterface_FriendlyName
Lcid = LOCALE_NEUTRAL
Flags = PLUGPLAY_PROPERTY_PERSISTENT
Type = DEVPROP_TYPE_STRING_INDIRECT
Size = BTHHFP_DESCRIPTOR.FriendlyName.Length + sizeof(UNICODE_NULL)
Data = BTHHFP_DESCRIPTOR.FriendlyName.Buffer
As described in Setting Properties and Registry Values, the driver can set registry values for a device interface. To register an APO, the audio driver sets several values on the device interface. These values are the same as those that are often set for APO registration in an INF, and the specific values will change from one audio driver to the next.
Here is an example of INF file syntax for registering an APO:
Note The syntax shown in the preceding snippet doesn't include instructions for registering the COM server of the APO.