ServiceRecordCreator.CreateServiceRecord(ServiceRecord) Method

Creates a Service Record byte array from the given ServiceRecord object.

Definition

Namespace: InTheHand.Net.Bluetooth.Sdp
Assembly: InTheHand.Net.Bluetooth (in InTheHand.Net.Bluetooth.dll) Version: 4.0.32+5cdf1cfd21064ea31c5de33d160200ca1c4bc218
C#
public byte[] CreateServiceRecord(
	ServiceRecord record
)

Parameters

record  ServiceRecord
An instance of ServiceRecord containing the record to be created.

Return Value

Byte[]
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.

See Also