ServiceRecordUtilitiesDump(TextWriter, ServiceRecord, Type) Method

Produce a 'dump' of the given record, including attribute names etc to the given TextWriter.

Definition

Namespace: InTheHand.Net.Bluetooth.Sdp
Assembly: InTheHand.Net.Bluetooth (in InTheHand.Net.Bluetooth.dll) Version: 4.0.32+5cdf1cfd21064ea31c5de33d160200ca1c4bc218
C#
public static void Dump(
	TextWriter writer,
	ServiceRecord record,
	params Type[] attributeIdEnumDefiningTypes
)

Parameters

writer  TextWriter
A TextWriter where the 'dump' text is to be written.
record  ServiceRecord
A ServiceRecord to be dumped.
attributeIdEnumDefiningTypes  Type
An optional array of Type specifing a set of Ids for the attributes contained in this record. See the

Remarks

The system has built-in a set of mappings from Service Class to its Attribute IDs. This is supplied by the MapServiceClassToAttributeIdList class, and contains the Attribute IDs defined in the base SDP specification as well as in Bluetooth Profiles specification e.g. ObjectPushProfile, Headset, Panu, etc. If however the record being decoded is a custom one then a set of extra Attribute Id definitions can be supplied in the attributeIdEnumDefiningTypes parameter. The Attribute IDs for a particular Service Class should be defined in a static class and the set of such classes should be passed as their Type object. e.g.

C#
static class FooAttributeId
{
    public const ServiceAttributeId BarName = (ServiceAttributeId)0x0300;
}

…
    ServiceRecordUtilities.Dump(writer, myRecord, typeof(FooAttributeId));
…

See Also