Re: Leopard & Bluetooth RFCOMM channels
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=dq6Uk9SqD9tv/Q/TtlZ6H0LrJkyBxADXZCSXuAnEfHA=; b=P0Jq/JfXq/sl7hiLXqn+oTVKJyHQqBxP2bTy5KN5dLTF64ZUgVri69s7oXqxX7umju4xqED9VEtWFqkKUL81KMLXmX8HnH1XQ5iEbA06ulLRVuyj4Y7U6ocUK0lrXoKzSdkx/yYX51KHOiC3mo/eigGEFE9fYNtp3QemiL7vNj8= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lPurMollCHD7Qhq0SuNj7vC/t+h5LmYyXLzTETQfpaMQH/jJR8S4ptNDkU0U7MMAF03egLRFN6bZuleAsSdxBMQkRHzpQCMvdNZolEXrHKU5rp2B9oU9m6x1I4cZsUHBwc3Y1OacrHtWxwGfXgKw81EMWljJcDqCeNPomMUf/CU= On 1/31/08, Joseph Kelly <joeman@mac.com> wrote:
Post the code that you're using to open the channel to the list and maybe somebody can spot something.
Here it goes: -(void)awakeFromNib { isConnected = false; [IOBluetoothDevice registerForConnectNotifications:self selector:@selector(newConnection:fromDevice:)]; } - (IBAction)click: (id)sender { NSArray *devices = [IOBluetoothDevice pairedDevices]; IOBluetoothDevice* dev = [devices objectAtIndex:0]; [dev openConnection]; } -(void)newConnection:(IOBluetoothUserNotification*)notification fromDevice:(IOBluetoothDevice*)device { NSLog(@"New connection from %@", [device getName]); IOReturn ret; NSArray* services = [device getServices]; BluetoothRFCOMMChannelID rfcommChannelID; for (IOBluetoothSDPServiceRecord* service in services) { NSLog(@"Service: %@", [service getServiceName]); ret = [service getRFCOMMChannelID:&rfcommChannelID]; if (ret == kIOReturnSuccess) { NSLog(@"ChannelID FOUND"); break; } } [device openRFCOMMChannelAsync:&channel withChannelID:rfcommChannelID delegate:self]; } This is just a cut from the source code that seems adequate to my question. Console output for this code is: 2008-01-31 11:16:24.600 BluetoothGPS[1059:10b] New connection from BT GPS V10 2008-01-31 11:16:24.601 BluetoothGPS[1059:10b] Service: Spp 2008-01-31 11:16:24.603 BluetoothGPS[1059:10b] ChannelID FOUND Ofcourse the class implements also all the RFCOMM delegate methods which don't get called at all. - (void)rfcommChannelOpenComplete:(IOBluetoothRFCOMMChannel*)rfcommChannel status:(IOReturn)error; - (void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel data:(void *)dataPointer length:(size_t)dataLength; - (void)rfcommChannelClosed:(IOBluetoothRFCOMMChannel*)rfcommChannel; - (void)rfcommChannelControlSignalsChanged:(IOBluetoothRFCOMMChannel*)rfcommChannel; - (void)rfcommChannelFlowControlChanged:(IOBluetoothRFCOMMChannel*)rfcommChannel; - (void)rfcommChannelWriteComplete:(IOBluetoothRFCOMMChannel*)rfcommChannel refcon:(void*)refcon status:(IOReturn)error; - (void)rfcommChannelQueueSpaceAvailable:(IOBluetoothRFCOMMChannel*)rfcommChannel; -- Pozdrawiam Janusz YANOUSHek Bossy http://digigal.art.pl gg# 791964 tlen yanoushek@tlen.pl jabber yanoushek@jabber.aster.pl _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Janusz Bossy