Detect bluetooth device on the iPhone

A
Alex
Thu, Sep 13, 2012 2:02 PM

Hi,

With pjsip I am able to use a paired bluetooth device, but, I don't see a way to detect if a device is available or not.

Is there a way to detect a paired bluetooth device?

Alex.

Hi, With pjsip I am able to use a paired bluetooth device, but, I don't see a way to detect if a device is available or not. Is there a way to detect a paired bluetooth device? Alex.
SM
s.marek (at) avm.de
Thu, Sep 13, 2012 2:21 PM

| Is there a way to detect a paired bluetooth device?

AFAIK, there is no clean API to do that. At least one person (me) has
already opened an enhancement request at Apple for that a long time ago.
;)

I worked around it with a little hack:

  • set up a short timer
  • enable bluetooth
  • if bluetooth gets enabled (watch for AudioRoute changes), cancel the
    timer
  • when the timer runs out, there is no bluetooth device connected

It works under the assumption, that someone starting a phone call with a
bluetooth device connected, wants to use that bluetooth device for the
phone call. Which is almost always the case ... I guess ... at least I've
gotten no complaints so far. ;)

Good luck,
Sebastian.

| Is there a way to detect a paired bluetooth device? AFAIK, there is no clean API to do that. At least one person (me) has already opened an enhancement request at Apple for that a long time ago. ;) I worked around it with a little hack: - set up a short timer - enable bluetooth - if bluetooth gets enabled (watch for AudioRoute changes), cancel the timer - when the timer runs out, there is no bluetooth device connected It works under the assumption, that someone starting a phone call with a bluetooth device connected, wants to use that bluetooth device for the phone call. Which is almost always the case ... I guess ... at least I've gotten no complaints so far. ;) Good luck, Sebastian.
A
Alex
Thu, Sep 13, 2012 4:18 PM

Too bad Apple does not provide a way for doing this. I will implement you hack.

Thanks!
Alex.

On Sep 13, 2012, at 8:21 AM, s.marek@avm.de wrote:

| Is there a way to detect a paired bluetooth device?

AFAIK, there is no clean API to do that. At least one person (me) has
already opened an enhancement request at Apple for that a long time ago.
;)

I worked around it with a little hack:

  • set up a short timer
  • enable bluetooth
  • if bluetooth gets enabled (watch for AudioRoute changes), cancel the
    timer
  • when the timer runs out, there is no bluetooth device connected

It works under the assumption, that someone starting a phone call with a
bluetooth device connected, wants to use that bluetooth device for the
phone call. Which is almost always the case ... I guess ... at least I've
gotten no complaints so far. ;)

Good luck,
Sebastian.


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Too bad Apple does not provide a way for doing this. I will implement you hack. Thanks! Alex. On Sep 13, 2012, at 8:21 AM, s.marek@avm.de wrote: > | Is there a way to detect a paired bluetooth device? > > AFAIK, there is no clean API to do that. At least one person (me) has > already opened an enhancement request at Apple for that a long time ago. > ;) > > I worked around it with a little hack: > - set up a short timer > - enable bluetooth > - if bluetooth gets enabled (watch for AudioRoute changes), cancel the > timer > - when the timer runs out, there is no bluetooth device connected > > It works under the assumption, that someone starting a phone call with a > bluetooth device connected, wants to use that bluetooth device for the > phone call. Which is almost always the case ... I guess ... at least I've > gotten no complaints so far. ;) > > Good luck, > Sebastian. > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org