<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/OBEXGetHeaders(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:@F@OBEXGetHeaders"
  },
  "title" : "OBEXGetHeaders(_:_:)"
}
-->

# OBEXGetHeaders(_:_:)

Take a data blob and looks for OBEX headers.

```
func OBEXGetHeaders(_ inData: UnsafeRawPointer!, _ inDataSize: Int) -> CFDictionary!
```

## Parameters

`inData`

The data chunk with the headers you are interested in.

`inDataSize`

The size of the buffer you are passing in.

## Return Value

A CFDictionary with the headers found in the data blob inside it.

## Discussion

You should use this when your callback for PUTs, GETs, etc. give you a data chunk and a size. Pass these params to this function and you will receive a dictionary back full of the parse headers. You can use the CFDictionary calls to get objects out of it, based on the header keys defined above. You are responsible for releasing the CFDictionary returned to you. Example usage:

```objc
 
   CFDictionaryRef   dictionary = OBEXGetHeaders( data, dataLength );
   if( dictionary )
   {
   	if( CFDictionaryGetCountOfKey( dictionary, kOBEXHeaderIDKeyName ) > 0 )
   	{
   		CFStringRef theStringRef;
 
   		theStringRef = (CFStringRef) CFDictionaryGetValue( dictionary, kOBEXHeaderIDKeyName );
   		if( theStringRef )
   		{
   			// Display it, use it as a filename, whatever.
   		}
   	}
 
   	if( CFDictionaryGetCountOfKey( dictionary, kOBEXHeaderIDKeyConnectionID ) > 0 )
   	{
   		CFDataRef theDataRef;
 
   		theDataRef = (CFDataRef) CFDictionaryGetValue( dictionary, kOBEXHeaderIDKeyConnectionID );
   		if( theDataRef )
   		{
   			// now we have data representing the connection ID.
   		}
   	}
 
   	CFRelease( dictionary );
   }
 
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)