---
title: "IOBluetoothNSStringToDeviceAddress(_:_:)"
framework: IOBluetooth
role: symbol
role_heading: Function
path: "iobluetooth/iobluetoothnsstringtodeviceaddress(_:_:)"
---

# IOBluetoothNSStringToDeviceAddress(_:_:)

Convenience routine to take an NSString and turn it into a BluetoothDeviceAddress structure.

## Declaration

```swift
func IOBluetoothNSStringToDeviceAddress(_ inNameString: String!, _ outDeviceAddress: UnsafeMutablePointer<BluetoothDeviceAddress>!) -> IOReturn
```

## Parameters

- `inNameString`: Ptr to an NSString that contains the data to turn into the device address.
- `outDeviceAddress`: Ptr to an address structure that will be returned.

## Return Value

Return Value Returns success (0) or failure code.

## Discussion

Discussion Pass in most types of strings, such as “001122334455” or “00-11-22-33-44-55” and the conversion should be successful. Also, you should have 2 characters per byte for the conversion to work properly.

## See Also

### Miscellaneous

- [IOBluetoothFindNumberOfRegistryEntriesOfClassName(_:)](iobluetooth/iobluetoothfindnumberofregistryentriesofclassname(_:).md)
- [IOBluetoothGetUniqueFileNameAndPath(_:_:)](iobluetooth/iobluetoothgetuniquefilenameandpath(_:_:).md)
- [IOBluetoothIsFileAppleDesignatedPIMData(_:)](iobluetooth/iobluetoothisfileappledesignatedpimdata(_:).md)
- [IOBluetoothNSStringFromDeviceAddress(_:)](iobluetooth/iobluetoothnsstringfromdeviceaddress(_:).md)
- [IOBluetoothNumberOfAvailableHIDDevices()](iobluetooth/iobluetoothnumberofavailablehiddevices().md)
- [IOBluetoothNumberOfKeyboardHIDDevices()](iobluetooth/iobluetoothnumberofkeyboardhiddevices().md)
- [IOBluetoothNumberOfPointingHIDDevices()](iobluetooth/iobluetoothnumberofpointinghiddevices().md)
- [IOBluetoothNumberOfTabletHIDDevices()](iobluetooth/iobluetoothnumberoftablethiddevices().md)
