---
title: "setSerialParameters(_:dataBits:parity:stopBits:)"
framework: IOBluetooth
role: symbol
role_heading: Instance Method
path: "iobluetooth/iobluetoothrfcommchannel/setserialparameters(_:databits:parity:stopbits:)"
---

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

Changes the parameters of the serial connection.

## Declaration

```swift
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

Return Value An error code value. 0 if successful.
