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

# OBEXSessionGetMaxPacketLength

Gets current max packet length.

```
OBEXError OBEXSessionGetMaxPacketLength(OBEXSessionRef inSessionRef, OBEXMaxPacketLength *outLength);
```

## Parameters

`inSessionRef`

A valid session reference.

`outLength`

Max packet length.

## Return Value

An error code value. 0 if successful.

## Discussion

This value *could* change before and after a connect command has been sent or a connect command response has been received, since the recipient could negotiate a lower max packet size.

*** DEPRECATED IN BLUETOOTH 2.2 (OS X v10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.

---

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)