<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/OBEXSession/getAvailableCommandResponsePayloadLength(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)OBEXSession(im)getAvailableCommandResponsePayloadLength:"
  },
  "title" : "getAvailableCommandResponsePayloadLength(_:)"
}
-->

# getAvailableCommandResponsePayloadLength(_:)

Determine the maximum amount of data you can send in a particular command response as an OBEX server session.

```
func getAvailableCommandResponsePayloadLength(_ inOpCode: OBEXOpCode) -> OBEXMaxPacketLength
```

## Parameters

`inOpCode`

The opcode you are interested in responding to (as a server).

## Return Value

The maximum amount of data a particular packet can handle, after accounting for any command response overhead.

## Discussion

Each OBEX Command response has a certain amount of overhead. Since the negotiated max packet length does not indicate what the maximum data amount you can send in a particular response’s packet, you can use this function to determine how much data to provide in optional headers or body data headers.

---

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)