public class ServiceRecordBuilder
Public Class ServiceRecordBuilder
public ref class ServiceRecordBuilder
type ServiceRecordBuilder = class end
The service’s Class Id can be set with the AddServiceClass(Guid)/AddServiceClass(UInt16)/etc methods, the protocol stack set with the ProtocolType property (default RFCOMM), and the Service Name set with the ServiceName property. Other properties and methods exist for controlling the more advanced attributes.
Adding the standard text-string attributes (ServiceName etc) is normally quite difficult due to the very baroque manner of specifying these strings’ character encoding and natural language. The builder handles all the complexity internally; the strings are written in UTF-8 encoding and marked as 'English' language.
ServiceRecordBuilder bldr = new ServiceRecordBuilder();
bldr.AddServiceClass(BluetoothService.SerialPort);
bldr.ServiceName = "Alan's SPP service";
//
ServiceRecord rcd = bldr.ServiceRecord;
ServiceRecordBuilder bldr = new ServiceRecordBuilder();
bldr.ProtocolType = BluetoothProtocolDescriptorType.GeneralObex;
bldr.AddServiceClass(BluetoothService.ObexFileTransfer);
bldr.ServiceName = "Alan's FTP service";
//
ServiceRecord rcd = bldr.ServiceRecord;
ServiceRecordBuilder | Create a new instance of the ServiceRecordBuilder class. |
ProtocolType | Get or set which type of element will be added for the ProtocolDescriptorList attribute. |
ProviderName | Get or set a value for the ProviderName attribute. |
ServiceDescription | Get or set a value for the ServiceDescription attribute. |
ServiceName | Get or set a value for the ServiceName attribute. |
ServiceRecord | Gets the ServiceRecord instance constructed by the specified ServiceRecordBuilder instance. |
AddBluetoothProfileDescriptor | Add a BluetoothProfileDescriptorList element. |
AddCustomAttribute(ServiceAttribute) | Add a custom attribute from a given ServiceAttribute |
AddCustomAttribute(ServiceAttributeId, ElementType, Object) | Add a custom attribute of simple type. |
AddCustomAttribute(UInt16, ElementType, Object) | Add a custom attribute of simple type. |
AddCustomAttributes(IEnumerable) | Add a set of custom attribute. |
AddCustomAttributes(IEnumerableServiceAttribute) | Add a set of custom attribute. |
AddCustomAttributes(ServiceAttribute) | Add a set of custom attribute. |
AddServiceClass(Guid) | Add a Service Class Id. |
AddServiceClass(Int32) | Add a Service Class Id. |
AddServiceClass(UInt16) | Add a Service Class Id. |
AddServiceClass(UInt32) | Add a Service Class Id. |
Equals | (Inherited from Object) |
Finalize | (Inherited from Object) |
FromJsr82ServerUri | Converts a Java JSR 82 Bluetooth server URL into a ServiceRecordBuilder instance. |
GetHashCode | (Inherited from Object) |
GetType | (Inherited from Object) |
MemberwiseClone | (Inherited from Object) |
ToString | (Inherited from Object) |