Hi everyone...
I'm just trying to build and run a small App I made using BT
:IOBluetoothUtilities.h and particularly this function
IOReturn IOBluetoothNSStringToDeviceAddress( NSString * inNameString,
BluetoothDeviceAddress * outDeviceAddress );
But it seems it's not working, does someone experienced problems with
it?
here's my code :
NOte that the device address was obtained previously : so it's good.
devAddressString=@"00-08-c6-13-45-e9";
BluetoothDeviceAddress * devAddress=nil;
NSLog(devAddressString);
IOBluetoothNSStringToDeviceAddress(devAddressString,
devAddress);
BtDevice=[IOBluetoothDevice withAddress:devAddress];
NSLog(@"the new name %s ",[BtDevice getName]);
here's what happens:
00-08-c6-13-45-e9
the new name (null)
And it bugs if I want to obtain the new device Address'
You must pass in a valid BluetoothDeviceAddress structure to fill in with the values from the string. Otherwise you are just passing a null pointer to the withAddress: method. So just change you line of: BluetoothDeviceAddress * devAddress=nil; To BluetoothDeviceAddress devAddress; And this line: IOBluetoothNSStringToDeviceAddress(devAddressString, devAddress); to: IOBluetoothNSStringToDeviceAddress(devAddressString, &devAddress); And that should work. Jason bubba@apple.com _______________________________________________ bluetooth-dev mailing list | bluetooth-dev@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/bluetooth-dev Do not post admin requests to the list. They will be ignored.
participants (1)
-
Bubba Giles