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

# sendData(toTransport:dataLength:)

You must override this to send data over your transport. This does nothing by default, it will return a kOBEXUnsupportedError.

```
func sendData(toTransport inDataToSend: UnsafeMutableRawPointer!, dataLength inDataLength: Int) -> OBEXError
```

## Parameters

`inDataToSend`

Data to shove over the transport to a remote OBEX session.

`inDataLength`

Length of data passed in.

## Discussion

Tranport subclasses must override this! When called you should send the data over the transport to the remote session.

---

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)