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

# setSerialParameters(_:dataBits:parity:stopBits:)

Changes the parameters of the serial connection.

```
func setSerialParameters(_ speed: UInt32, dataBits nBits: UInt8, parity: BluetoothRFCOMMParityType, stopBits bitStop: UInt8) -> IOReturn
```

## Parameters

`speed`

the baudrate.

`nBits`

number of data bits.

`parity`

the type of parity can be NoParity, OddParity, EvenParity or MaxParity.

`bitStop`

number of stop bits.

## Return Value

An error code value. 0 if successful.

---

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)