ADC Home > Reference Library > Reference > Hardware & Drivers > Bluetooth > Bluetooth Framework Reference

 


IOBluetoothSDPUUID

Inherits from:

NSData

Declared In:

Overview

An NSData subclass that represents a UUID as defined in the Bluetooth SDP spec.

Discussion

The IOBluetoothSDPUUID class can represent a UUID of any valid size (16, 32 or 128 bits). It provides the ability to compare two UUIDs no matter what their size as well as the ability to promote the size of a UUID to a larger one.



Methods

-bytes

Returns a pointer to the array of UUID bytes.

-getSDPUUIDRef

Returns an IOBluetoothSDPUUIDRef representation of the target IOBluetoothSDPUUID object.

-getUUIDWithLength:

Returns an IOBluetoothSDPUUID object matching the target UUID, but with the given number of bytes.

-initWithBytes:length:

Initializes a new IOBluetoothSDPUUID object with the given bytes of the given length.

-initWithData:

Initializes a new IOBluetoothSDPUUID object with the bytes in the given NSData.

-initWithUUID16:

Initializes a new 16-bit IOBluetoothSDPUUID with the given UUID16

-initWithUUID32:

Creates a new 32-bit IOBluetoothSDPUUID with the given UUID32

-isEqualToData:

Compares the target IOBluetoothSDPUUID data with that of the given NSData parameter.

-isEqualToUUID:

Compares the target IOBluetoothSDPUUID object with the given otherUUID object.

-length

Returns the length (in bytes) of the UUID.

+uuid16:

Creates a new 16-bit IOBluetoothSDPUUID with the given UUID16

+uuid32:

Creates a new 32-bit IOBluetoothSDPUUID with the given UUID32

+uuidWithBytes:length:

Creates a new IOBluetoothSDPUUID object with the given bytes of the given length.

+uuidWithData:

Creates a new IOBluetoothSDPUUID object from the given NSData.

+withSDPUUIDRef:

Method call to convert an IOBluetoothSDPUUIDRef into an IOBluetoothSDPUUID *.


bytes


Returns a pointer to the array of UUID bytes.

- (const void *)bytes; 
Return Value

Returns a pointer to the array of UUID bytes.

Discussion

This is one of the required NSData primitive methods.


getSDPUUIDRef


Returns an IOBluetoothSDPUUIDRef representation of the target IOBluetoothSDPUUID object.

- (IOBluetoothSDPUUIDRef)getSDPUUIDRef; 
Return Value

Returns an IOBluetoothSDPUUIDRef representation of the target IOBluetoothSDPUUID object.


getUUIDWithLength:


Returns an IOBluetoothSDPUUID object matching the target UUID, but with the given number of bytes.

- (IOBluetoothSDPUUID *)getUUIDWithLength:(unsigned)newLength; 
Parameters
newLength

The desired length for the UUID.

Return Value

Returns an IOBluetoothSDPUUID object with the same data as the target but with the given length if it is possible to do so. Otherwise, nil is returned.

Discussion

If the target object is the same length as newLength, it returns self. If newLength is greater it creates a new IOBluetoothSDPUUID object with the correct value for the given length. If newLength is smaller, it will attempt to create a new IOBluetoothSDPUUID that is smaller if the data matches the Bluetooth UUID base. This downconversion is currently unimplemented.


initWithBytes:length:


Initializes a new IOBluetoothSDPUUID object with the given bytes of the given length.

- (id)initWithBytes:(const void *)bytes length:(unsigned)length; 
Parameters
bytes

An array of bytes representing the UUID.

length

The lenght of the array of bytes.

Return Value

Returns self on success or nil on failure.

Discussion

If the length is invalid for a UUID, nil is returned.


initWithData:


Initializes a new IOBluetoothSDPUUID object with the bytes in the given NSData.

- (id)initWithData:(NSData *)data; 
Parameters
data

The NSData containing the UUID bytes.

Return Value

Returns self on success or nil on failure.

Discussion

If the length of the NSData is invalid for a UUID, nil is returned.


initWithUUID16:


Initializes a new 16-bit IOBluetoothSDPUUID with the given UUID16

- (id)initWithUUID16:(BluetoothSDPUUID16)uuid16; 
Parameters
uuid16

A scalar representing a 16-bit UUID

Return Value

Returns self.


initWithUUID32:


Creates a new 32-bit IOBluetoothSDPUUID with the given UUID32

- (id)initWithUUID32:(BluetoothSDPUUID32)uuid32; 
Parameters
uuid32

A scalar representing a 32-bit UUID

Return Value

Returns self.


isEqualToData:


Compares the target IOBluetoothSDPUUID data with that of the given NSData parameter.

- (BOOL)isEqualToData:(NSData *)otherData; 
Parameters
otherData

An NSData object to be compared with the target.

Return Value

Returns true if the UUID values of each object are equal. This includes the case where the sizes are different but the data itself is the same when the Bluetooth UUID base is applied.

Discussion

This method will compare the bytes of the two objects even if the otherData parameter is not an IOBluetoothSDPUUID object.


isEqualToUUID:


Compares the target IOBluetoothSDPUUID object with the given otherUUID object.

- (BOOL)isEqualToUUID:(IOBluetoothSDPUUID *)otherUUID; 
Parameters
otherUUID

The UUID object to be compared with the target.

Return Value

Returns true if the UUID values of each object are equal. This includes the case where the sizes are different but the data itself is the same when the Bluetooth UUID base is applied.

Discussion

This method will compare the two UUID values independent of their length.


length


Returns the length (in bytes) of the UUID.

- (unsigned)length; 
Return Value

Returns the length (in bytes) of the UUID.

Discussion

This is one of the required NSData primitive methods.


uuid16:


Creates a new 16-bit IOBluetoothSDPUUID with the given UUID16

+ (IOBluetoothSDPUUID *)uuid16:(BluetoothSDPUUID16)uuid16; 
Parameters
uuid16

A scalar representing a 16-bit UUID

Return Value

Returns the new IOBluetoothSDPUUID object.


uuid32:


Creates a new 32-bit IOBluetoothSDPUUID with the given UUID32

+ (IOBluetoothSDPUUID *)uuid32:(BluetoothSDPUUID32)uuid32; 
Parameters
uuid32

A scalar representing a 32-bit UUID

Return Value

Returns the new IOBluetoothSDPUUID object.


uuidWithBytes:length:


Creates a new IOBluetoothSDPUUID object with the given bytes of the given length.

+ (IOBluetoothSDPUUID *)uuidWithBytes:(const void *)bytes 
        length:(unsigned)length; 
Parameters
bytes

An array of bytes representing the UUID.

length

The length of the array of bytes.

Return Value

Returns the new IOBluetoothSDPUUID object or nil on failure.

Discussion

If the length is invalid for a UUID, nil is returned.


uuidWithData:


Creates a new IOBluetoothSDPUUID object from the given NSData.

+ (IOBluetoothSDPUUID *)uuidWithData:(NSData *)data; 
Parameters
data

The NSData containing the UUID bytes.

Return Value

Returns the new IOBluetoothSDPUUID object or nil on failure.

Discussion

If the length of the NSData is invalid for a UUID, nil is returned.


withSDPUUIDRef:


Method call to convert an IOBluetoothSDPUUIDRef into an IOBluetoothSDPUUID *.

+ (IOBluetoothSDPUUID *)withSDPUUIDRef:(IOBluetoothSDPUUIDRef)sdpUUIDRef; 
Parameters
sdpUUIDRef

IOBluetoothSDPUUIDRef for which an IOBluetoothSDPUUID * is desired.

Return Value

Returns the IOBluetoothSDPUUID * for the given IOBluetoothSDPUUIDRef.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-08-07