From: Davide V. <var...@ya...> - 2006-02-23 22:35:52
|
Hi, I've already post this message to the ruby group, but no one replied me, I hope for your help. So... I'm trying to connect, over bluetooth, to a mobile device and send apicure. That's my code: require 'osx/cocoa' OSX::NSBundle.bundleWithPath("/System/Library/Frameworks/IOBluetoothUI.framework").load OSX.ns_import :IOBluetoothDeviceSelectorController bluedevices = OSX::IOBluetoothDeviceSelectorController.deviceSelector bluedevices.runModal; result = bluedevices.getResults; bluetoothDevice = result.objectAtIndex(0); OSX::NSBundle.bundleWithPath("/System/Library/Frameworks/IOBluetooth.framework").load; OSX.ns_import :IOBluetoothOBEXSession; obexSession = OSX::IOBluetoothOBEXSession.withDevice_channelID(bluetoothDevice, 9); OSX.ns_import :OBEXFileTransferServices; service = OSX::OBEXFileTransferServices.withOBEXSession(obexSession); connectResult = service.connectToFTPService; puts connectResult; sleep 3; sendResult=service.sendFile("/Users/davide/myPicture.jpeg"); puts sendResult; sleep 3; service.disconnect; I know the channel id for ftp on my device is 9, puts connectResult displays 0, but puts sendResult shows -21875 (i.e busy) and of course, no picture is sent to the device. Do you understand this behavior? TIA Davide __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |