[Pyobjc-dev] IOBluetooth / openRFCOMMChannel / Bluetooth / passing pointer to pointer
Brought to you by:
ronaldoussoren
From: Follower <fol...@ra...> - 2006-08-30 13:47:34
|
Hi, I'm attempting to leverage PyObjC on OS X 10.4 to use the IOBluetooth framework to communicate with another bluetooth device from Python. I've had some success with completing device inquiries and service discovery but I can't open a channel because I'm not sure how to supply the pointer to the pointer to the IOBluetoothRFCOMMChannel required by this selector: - (IOReturn)openRFCOMMChannel:(BluetoothRFCOMMChannelID)channelID channel:(IOBluetoothRFCOMMChannel **)rfcommChannel; See: <http://developer.apple.com/documentation/DeviceDrivers/Reference/IOBluetooth/IOBluetoothDevice/Classes/IOBluetoothDevice/CompositePage.html#//apple_ref/doc/title:instm/IOBluetoothDevice/openRFCOMMChannel:channel:> I'm pretty much stumbling around in the dark with both PyObjC and Objective-C itself but from my various reading I'm thinking that it's *not* actually possible to use this selector directly from Python due to the rfcommChannel parameter. Is this conclusion correct? If so, does this mean I'd need to write some sort of wrapper module in Objective-C to handle this? I managed to hack up a working tool using only Objective-C to successfully open the channel using: IOBluetoothRFCOMMChannel *channel; // .... [device openRFCOMMChannel:1 channel: &channel]; but it would be nice to know if I can actually do the same thing directly. Thanks in advance for any help you can provide. --Phil. |