| C# | Visual Basic |
public class ServiceRecordBuilder
Public Class ServiceRecordBuilder
| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description |
|---|---|---|
| ServiceRecordBuilder()()() |
Create a new instance of the ServiceRecordBuilder class.
| |
| AddBluetoothProfileDescriptor(Guid, Byte, Byte) |
Add a BluetoothProfileDescriptorList
element.
| |
| AddCustomAttribute(ServiceAttribute) |
Add a custom attribute.
| |
| AddCustomAttributes(IEnumerable<(Of <(ServiceAttribute>)>)) |
Add a set of custom attribute.
| |
| AddCustomAttributes(IEnumerable) |
Add a set of custom attribute.
| |
| AddCustomAttributes(array<ServiceAttribute>[]()[]) |
Add a set of custom attribute.
| |
| AddServiceClass(Guid) |
Add a Service Class Id.
| |
| AddServiceClass(UInt16) |
Add a Service Class Id.
| |
| AddServiceClass(UInt32) |
Add a Service Class Id.
| |
| AddServiceClass(Int32) |
Add a Service Class Id.
| |
| Equals(Object) | (Inherited from Object.) | |
| Finalize()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
| FromJsr82ServerUri(String) |
Converts a Java JSR 82 Bluetooth server URL into a
ServiceRecordBuilder instance.
| |
| GetHashCode()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetType()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| MemberwiseClone()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| 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.
| |
| ToString()()() | (Inherited from Object.) |
The service’s Class Id can be set with the AddServiceClass()()() (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;
| Object | |
| ServiceRecordBuilder | |