ServiceRecordHelperCreateL2CapProtocolDescriptorListWithUpperLayers Method

Creates the data element for the ProtocolDescriptorList attribute in an L2CAP service, with upper layer entries.

Definition

Namespace: InTheHand.Net.Bluetooth.Sdp
Assembly: InTheHand.Net.Bluetooth (in InTheHand.Net.Bluetooth.dll) Version: 4.0.32+5cdf1cfd21064ea31c5de33d160200ca1c4bc218
C#
public static ServiceElement CreateL2CapProtocolDescriptorListWithUpperLayers(
	params ServiceElement[] upperLayers
)

Parameters

upperLayers  ServiceElement
The list of upper layer elements, one per layer. As an array.

Return Value

ServiceElement
The new ServiceElement.

Remarks

Thus is the following structure at the first layer:
 
ElementSequence
   ElementSequence
      Uuid16 = L2CAP
      UInt16 = 0      -- The L2CAP PSM Number.
One can add layers above that; remember that all layers are formed of an ElementSequence. See the example below.

Example

C#
var netProtoList = new ServiceElement(ElementType.ElementSequence,
    ServiceElement.CreateNumericalServiceElement(ElementType.UInt16, 0x0800),
    ServiceElement.CreateNumericalServiceElement(ElementType.UInt16, 0x0806)
    );
var layer1 = new ServiceElement(ElementType.ElementSequence,
    new ServiceElement(ElementType.Uuid16, Uuid16_BnepProto),
    ServiceElement.CreateNumericalServiceElement(ElementType.UInt16, 0x0100), //v1.0
    netProtoList
    );
ServiceElement element = ServiceRecordHelper.CreateL2CapProtocolDescriptorListWithUpperLayers(
    layer1);

See Also