Getting list of bluetooth devices nearby on iphone sdk

Posted by Michael Cindric on Stack Overflow See other posts from Stack Overflow or by Michael Cindric
Published on 2010-02-16T03:19:13Z Indexed on 2010/03/25 23:03 UTC
Read the original article Hit count: 899

Filed under:
|
|

Hi Guys,

I need to be able to search for all bluetooth devices nearby and just get there ids. I don't need to pair at all. I am using iphone 2.3 beta.

Is this possible l have tried using GameKit and no luck does anyone know how to do this.

 BOOL result = NO;
if (!session) {
    session = [[GKSession alloc] initWithSessionID:@"SCANNER" 
                                        displayName:nil 
                                        sessionMode:GKSessionModePeer];
    self.session.delegate = self;
    [self.session setDataReceiveHandler:self withContext:nil];
    self.session.available = YES;
    result = YES;
}

it dies on [self.session setDataReceiveHandler:self withContext:nil];

with the following error

Scanner[42754:207] Error: 30500 -- Invalid parameter for -setDataReceiveHandler:withContext:.

then ~ DNSServiceRegister callback: Ref=471fa40, Flags=2, ErrorType=0 name=00rusor1A..iPhone Simulator regtype=_q1eu29voete9jf._udp. domain=local.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about bluetooth