In The Hand
CreateServiceRecord Method (record)
NamespacesInTheHand.Net.BluetoothServiceRecordCreatorCreateServiceRecord(ServiceRecord)
.NET Components for Mobility
Creates a Service Record byte array from the given ServiceRecord object.
Declaration Syntax
C#Visual Basic
public byte[] CreateServiceRecord(
	ServiceRecord record
)
Public Function CreateServiceRecord ( _
	record As ServiceRecord _
) As Byte()
Parameters
record (ServiceRecord)
An instance of ServiceRecord containing the record to be created.
Return Value
An array of Byte containing the resultant record bytes. The length of the array is the length of the record bytes.
Remarks

The only oddity (as with parsing) is with the TextString type. The ServiceElement can either hold the string already encoded to its array of bytes or an String. In the latter case we will always simply encode the string to an array of bytes using encoding UTF8.

Currently any UUIDs in the record are written out in the form supplied, we should probably write a ‘short-form’ equivalent if its a ‘Bluetooth-based’ UUID e.g. Uuid128 as Uuid16.

Assembly: InTheHand.Net.Personal (Module: InTheHand.Net.Personal) Version: 3.0.0.0