| C# | Visual Basic |
public static void Dump( TextWriter writer, ServiceRecord record, params Type[] attributeIdEnumDefiningTypes )
Public Shared Sub Dump ( _ writer As TextWriter, _ record As ServiceRecord, _ ParamArray attributeIdEnumDefiningTypes As Type() _ )
- writer (TextWriter)
- A TextWriter where the 'dump' text is to be written.
- record (ServiceRecord)
- A ServiceRecord to be dumped.
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.
CopyC#static class FooAttributeId
{
public const ServiceAttributeId BarName = (ServiceAttributeId)0x0300;
}
…
ServiceRecordUtilities.Dump(writer, myRecord, typeof(FooAttributeId));
…