ServiceRecordHelperSetL2CapPsmNumber Method

Sets the RFCOMM Channel Number value in the service record.

Definition

Namespace: InTheHand.Net.Bluetooth.Sdp
Assembly: InTheHand.Net.Bluetooth (in InTheHand.Net.Bluetooth.dll) Version: 4.0.32+5cdf1cfd21064ea31c5de33d160200ca1c4bc218
C#
public static void SetL2CapPsmNumber(
	ServiceRecord record,
	int psm
)

Parameters

record  ServiceRecord
The ServiceRecord in which to set the L2CAP PSM value.
psm  Int32
The PSM value to set in the record. Note that although the parameter is of type Int32 the value must actually be in the range of a UInt16, see the remarks for more information.

Remarks

Note: We use an Int32 for the psm parameter as its natural type UInt16 in not usable in CLS Compliant interfaces.

Exceptions

InvalidOperationExceptionThe ProtocolDescriptorList attribute is missing or contains invalid elements.
ArgumentOutOfRangeException The PSM must fit in a 16-bit unsigned integer.

See Also