ServiceRecordHelperCreateL2CapProtocolDescriptorListWithUpperLayers Method
Creates the data element for the
ProtocolDescriptorList
attribute in an L2CAP service,
with upper layer entries.
Namespace: InTheHand.Net.Bluetooth.SdpAssembly: InTheHand.Net.Bluetooth (in InTheHand.Net.Bluetooth.dll) Version: 4.0.32+5cdf1cfd21064ea31c5de33d160200ca1c4bc218
public static ServiceElement CreateL2CapProtocolDescriptorListWithUpperLayers(
params ServiceElement[] upperLayers
)
Public Shared Function CreateL2CapProtocolDescriptorListWithUpperLayers (
ParamArray upperLayers As ServiceElement()
) As ServiceElement
public:
static ServiceElement^ CreateL2CapProtocolDescriptorListWithUpperLayers(
... array<ServiceElement^>^ upperLayers
)
static member CreateL2CapProtocolDescriptorListWithUpperLayers :
upperLayers : ServiceElement[] -> ServiceElement
- upperLayers ServiceElement
- The list of upper layer elements, one per layer.
As an array.
ServiceElementThe new
ServiceElement.
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.
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);